mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-25 18:13:52 +03:00
8a3fba8831
* Require LTS node and npm on client and server * Update node and npm versions in the docs * Add npmrc and nvmrc to WebAppGenerator * Change function name in test * Add newline to nvmrc * Add newline to Common.hs * Remove extra empty line in nvmrc * Remove extra empty line in Common.hs * Update end to end tests for node LTS * Add newline at the end of server/nvmrc * Ensure Node version 16 in CI * Fix broken ci file * Change how Wasp specifies required versions * Fix formatting * Use type alias for semantic versions * Remove incorrect comment on Prisma LTS * Update e2e checksums * Fix typo in gitignore Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com> * Sort e2e checksums * Extract semantic version to its module * Fix formatting * Fix formatting again * Add comment explaining nvmrc * Add tests and change semver naming * Add natural numbers and formatting to semver * Add newline at the end of semver module * Add missing space to node mismatch message Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
40 lines
1.8 KiB
Haskell
40 lines
1.8 KiB
Haskell
module SemanticVersionTest where
|
|
|
|
import Test.Tasty.Hspec
|
|
import Wasp.SemanticVersion
|
|
|
|
spec_isVersionInBounds :: Spec
|
|
spec_isVersionInBounds = do
|
|
it "Correctly determines satisfied exact version bounds" $
|
|
Version 1 2 3 `isVersionInBounds` Exact (Version 1 2 3)
|
|
it "Correctly determines unsatisfied exact version bounds" $
|
|
not $
|
|
any
|
|
(`isVersionInBounds` Exact (Version 1 2 3))
|
|
[Version 2 2 3, Version 1 3 3, Version 1 2 4]
|
|
it "Correctly determine satisfied backwards compatible version bounds" $
|
|
all
|
|
(`isVersionInBounds` BackwardsCompatibleWith (Version 1 2 3))
|
|
[Version 1 2 3, Version 1 2 4, Version 1 3 0]
|
|
it "Correctly determines unsatisfied backwards compatible version bounds" $
|
|
not $
|
|
any
|
|
(`isVersionInBounds` BackwardsCompatibleWith (Version 1 2 3))
|
|
[Version 1 2 0, Version 1 2 2, Version 2 0 0]
|
|
it "Correctly determines satisfied backwards compatible version bounds with 0.x versions" $
|
|
all
|
|
(`isVersionInBounds` BackwardsCompatibleWith (Version 0 2 3))
|
|
[Version 0 2 3, Version 0 2 4]
|
|
it "Correctly determines unsatisfied backwards compatible version bounds with 0.x versions" $
|
|
not $
|
|
any
|
|
(`isVersionInBounds` BackwardsCompatibleWith (Version 0 2 3))
|
|
[Version 0 0 0, Version 0 1 3, Version 0 2 0, Version 0 2 2, Version 0 3 0, Version 1 0 0]
|
|
it "Correctly determines satisfied backwards compatible version bounds with 0.0.x versions" $
|
|
Version 0 0 2 `isVersionInBounds` BackwardsCompatibleWith (Version 0 0 2)
|
|
it "Correctly determines unsatisfied backwards compatible version bounds with 0.0.x versions" $
|
|
not $
|
|
any
|
|
(`isVersionInBounds` BackwardsCompatibleWith (Version 0 0 2))
|
|
[Version 0 0 1, Version 0 0 3, Version 0 1 0, Version 1 0 0]
|