mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-20 15:41:38 +03:00
86e0893d6f
* Separate ext code to client and server * Use skeleton in createNewProject and refactor * Refactor Lib.hs to use ExceptT * Fix formatting * Pop up returns * Extract liftIO and add a do block Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com> * Address some review comments * Add skeleton comment * Extract common CommandError message * Separate skeleton comment into two rows * Move server and client dirs into src * Simplify maybeToEither * Further refactor Lib.hs * Further simplify skeleton comment * Add shared code directory to project structure * Update e2e test inputs * Update e2e test outputs * Fix formatting * Fix bug in compile function Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com> * Change map to fmap in compile function * Fix formatting * Force git to include empty directories * Remove extra empty line from .gitkeep files * Watch shared directory for changes * Fix regular and e2e tests * Fix cli template packaging and update todoApp * Add a shared function demo to todoApp * Update waspc and e2e tests * Fix compiler warnings and rename function * Rename mkError to mkParserError * Remove redundant empty line * Fix test warnings * Fix formatting * Fix directory tree watching on wasp start * Implement review feedback Co-authored-by: Shayne Czyzewski <523636+shayneczyzewski@users.noreply.github.com> Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
37 lines
829 B
Haskell
37 lines
829 B
Haskell
module Tests.WaspJobTest (waspJob) where
|
|
|
|
import GoldenTest (GoldenTest, makeGoldenTest)
|
|
import ShellCommands
|
|
( appendToWaspFile,
|
|
cdIntoCurrentProject,
|
|
createFile,
|
|
setDbToPSQL,
|
|
waspCliCompile,
|
|
waspCliNew,
|
|
)
|
|
|
|
waspJob :: GoldenTest
|
|
waspJob = do
|
|
let entityDecl =
|
|
" job MySpecialJob { \n\
|
|
\ executor: PgBoss, \n\
|
|
\ perform: { \n\
|
|
\ fn: import { foo } from \"@server/jobs/bar.js\" \n\
|
|
\ } \n\
|
|
\ } \n"
|
|
|
|
let jobFile =
|
|
" export const foo = async (args) => { \n\
|
|
\ return 1 \n\
|
|
\ } \n"
|
|
|
|
makeGoldenTest "waspJob" $
|
|
sequence
|
|
[ waspCliNew,
|
|
cdIntoCurrentProject,
|
|
setDbToPSQL,
|
|
appendToWaspFile entityDecl,
|
|
createFile jobFile "./src/server/jobs" "bar.js",
|
|
waspCliCompile
|
|
]
|