mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-24 03:35:17 +03:00
22 lines
954 B
Haskell
22 lines
954 B
Haskell
|
module Generator.DbGeneratorTest where
|
||
|
|
||
|
import Test.Tasty.Hspec (Spec, it, shouldBe)
|
||
|
import Wasp.Generator.DbGenerator.Common
|
||
|
( MigrateArgs (..),
|
||
|
defaultMigrateArgs,
|
||
|
)
|
||
|
import Wasp.Generator.DbGenerator.Jobs (asPrismaCliArgs)
|
||
|
|
||
|
spec_Jobs :: Spec
|
||
|
spec_Jobs =
|
||
|
it "should produce expected args" $ do
|
||
|
asPrismaCliArgs defaultMigrateArgs `shouldBe` []
|
||
|
asPrismaCliArgs (MigrateArgs {_migrationName = Nothing, _isCreateOnlyMigration = True})
|
||
|
`shouldBe` ["--create-only"]
|
||
|
asPrismaCliArgs (MigrateArgs {_migrationName = Just "something", _isCreateOnlyMigration = False})
|
||
|
`shouldBe` ["--name", "something"]
|
||
|
asPrismaCliArgs (MigrateArgs {_migrationName = Just "something else longer", _isCreateOnlyMigration = False})
|
||
|
`shouldBe` ["--name", "something else longer"]
|
||
|
asPrismaCliArgs (MigrateArgs {_migrationName = Just "something", _isCreateOnlyMigration = True})
|
||
|
`shouldBe` ["--create-only", "--name", "something"]
|