Skip to content

Commit

Permalink
Add TS tests tooling (#661)
Browse files Browse the repository at this point in the history
* install test dependencies

* change config for tests

* fix linter failing tests

* add basic test file

* add custom element registration to test

* update dependencies

* add jest config file

* fix test calls on makefile and minor fix on test

* update local npm version

* clean testm file
  • Loading branch information
fpliger committed Aug 16, 2022
1 parent 8275aa2 commit 8aba271
Show file tree
Hide file tree
Showing 7 changed files with 12,346 additions and 3,403 deletions.
5 changes: 3 additions & 2 deletions pyscriptjs/Makefile
Expand Up @@ -68,7 +68,8 @@ examples:
test:
make examples
npm run build
$(conda_run) pytest -vv $(ARGS) tests/ --log-cli-level=warning
make test-ts
make test-py

test-local:
make examples
Expand All @@ -81,7 +82,7 @@ test-py:

test-ts:
@echo "Tests are coming :( this is a placeholder and it's meant to fail!"
npm run tests
npm run test

fmt: fmt-py fmt-ts
@echo "Format completed"
Expand Down
14 changes: 14 additions & 0 deletions pyscriptjs/jest.config.js
@@ -0,0 +1,14 @@
//jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
},
verbose: true,
testEnvironmentOptions: {
url: "http://localhost"
}
};

0 comments on commit 8aba271

Please sign in to comment.