Skip to content

Comments

Fix dev script, test scripts; add jest config file (fixes #62)#63

Open
weedySeaDragon wants to merge 5 commits intopkl-community:mainfrom
weedySeaDragon:chore/62-fix-dev-script-tsc-and-run
Open

Fix dev script, test scripts; add jest config file (fixes #62)#63
weedySeaDragon wants to merge 5 commits intopkl-community:mainfrom
weedySeaDragon:chore/62-fix-dev-script-tsc-and-run

Conversation

@weedySeaDragon
Copy link

Fixes #62

  1. Added a configuration file for jest. Added "testMatches" patterns to explicitly include directories jest should consider as valid directories for tests and ignore the dist directory:
testMatch: [
    "<rootDir>/codegen/**/*.test.ts",
    "<rootDir>/e2e/**/*.ts",
    "<rootDir>/src/**/*.test.ts",
    "!**/dist/**",
  ]
  1. dev script in package.json now first compiles everything to make sure it's all up to date, then runs pkl-typescript/main with a simple pkl module from the examples:

  2. test:e2e explicitly specifies the ./e2e directory so that any future jest tests that need to run in different directories can be added. (And to make it clear that the e2e tests are all in that directory.)

  3. Added test:pkl and test:jest to be able to run all pkl tests and all jest tests separately. This made it easy to...

  4. Simplified test: it now just needs to run test:pkl and test:jest

Questions:

  1. Should the tests first compile everything to ensure it's all up to date? This is what I'm used to. This would mean that we need a script to just explicitly compile/generate everything.
    • I'm used to having the dev script only compile/generate/etc., things so they're up to date, and having a separate script to do a test run (i.e. "tsx pkl-gen-typescript/main.ts ./examples/basic-intro/config.pkl"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot run dev package.json script; missing pkl module file argument; jest tries to run ./dist

1 participant