Skip to content

Commit

Permalink
Merge pull request #1832 from demergent-labs/jest_fg_examples
Browse files Browse the repository at this point in the history
Update examples that start with "f" or "g" to use jest
lastmjs authored Jun 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 622f6a5 + dad1ae0 commit 95413bd
Showing 36 changed files with 46,226 additions and 16,753 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -13,8 +13,7 @@
# The basic-integration-tests matrix spins up one job per combination of example directory and code source (repo or npm).
# The check-basic-integration-tests-success job is designed to ensure that all jobs spun up from the matrix in the basic-integration-tests have succeeded

# All Examples TODO restore when https://github.com/demergent-labs/azle/issues/1192 is resolved
# "examples/generics",
# Restore when https://github.com/demergent-labs/azle/issues/1799 is resolved
# "examples/run_time_errors",

# TODO http_counter tests are being skipped until this is resolved: https://forum.dfinity.org/t/lookuppathabsent/23461
9 changes: 9 additions & 0 deletions examples/fetch_ic/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.js$': 'ts-jest'
}
};
18,809 changes: 13,374 additions & 5,435 deletions examples/fetch_ic/package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion examples/fetch_ic/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"scripts": {
"build": "cd src/frontend && VITE_CANISTER_ORIGIN=http://$(dfx canister id backend).localhost:$(dfx info webserver-port) VITE_IDENTITY_PROVIDER=http://$(dfx canister id internet_identity).localhost:$(dfx info webserver-port) vite build",
"pretest": "ts-node --transpile-only --ignore=false --skip-project test/pretest.ts",
"test": "ts-node --transpile-only --ignore=false --skip-project test/test.ts"
"test": "jest"
},
"dependencies": {
"@dfinity/auth-client": "^1.0.1",
@@ -12,7 +12,9 @@
},
"devDependencies": {
"@types/express": "^4.17.21",
"jest": "^29.7.0",
"puppeteer": "^22.2.0",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^5.0.12"
2 changes: 1 addition & 1 deletion examples/fetch_ic/test/test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { runTests } from 'azle/test';
import { runTests } from 'azle/test/jest';

import { getTests } from './tests';

Loading

0 comments on commit 95413bd

Please sign in to comment.