Skip to content

Commit

Permalink
Merge pull request #1867 from demergent-labs/jest_l-m
Browse files Browse the repository at this point in the history
jest examples l-m
  • Loading branch information
lastmjs authored Jul 9, 2024
2 parents 9752896 + 21fbc00 commit 9f7b223
Show file tree
Hide file tree
Showing 13 changed files with 24,488 additions and 6,604 deletions.
10 changes: 10 additions & 0 deletions examples/ledger_canister/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.js$': 'ts-jest'
},
transformIgnorePatterns: ['/node_modules/(?!(azle)/)'] // Make sure azle is transformed
};
9,618 changes: 7,850 additions & 1,768 deletions examples/ledger_canister/package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion examples/ledger_canister/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"scripts": {
"pre_tests": "ts-node --transpile-only --ignore=false test/pretest.ts",
"tests": "npm run pre_tests && ts-node --transpile-only --ignore=false test/test.ts",
"tests": "npm run pre_tests && jest",
"test": "AZLE_TEST_FETCH=false npm run tests && AZLE_TEST_FETCH=true npm run tests"
},
"dependencies": {
"azle": "0.22.0"
},
"devDependencies": {
"@dfinity/agent": "^0.19.2",
"jest": "^29.7.0",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ledger_canister/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { getCanisterId } from 'azle/dfx';
import { runTests } from 'azle/test';

import { createActor } from '../test/dfx_generated/ledger_canister';
import { createActor } from './dfx_generated/ledger_canister';
import { getTests } from './tests';

const ledgerCanister = createActor(getCanisterId('ledger_canister'), {
Expand Down
Loading

0 comments on commit 9f7b223

Please sign in to comment.