|
51 | 51 | "gen:schema-TODO": "//TODO: use ajv compile --code-esm option after merge: https://github.com/ajv-validator/ajv-cli/pull/200", |
52 | 52 | "gen:templates": "yarn build && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'p2pkh' > src/lib/transaction/fixtures/templates/p2pkh.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' '2-of-3' > src/lib/transaction/fixtures/templates/2-of-3.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' '2-of-2-recoverable' > src/lib/transaction/fixtures/templates/2-of-2-recoverable.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'sig-of-sig' > src/lib/transaction/fixtures/templates/sig-of-sig.json && node 'build/lib/transaction/fixtures/generate-templates.spec.helper.js' 'cash-channels-v1' > src/lib/transaction/fixtures/templates/cash-channels-v1.json && prettier 'src/lib/transaction/fixtures/templates/*.json' --write", |
53 | 53 | "gen:graph": "mkdir -p temp && madge --image temp/deps-$(date +\"%FT%H%M\").svg build/index.js", |
54 | | - "test": "yarn build && yarn test:deps && yarn test:schemas && yarn test:lint && yarn test:cycles && yarn test:unit", |
| 54 | + "test": "yarn build && yarn test:policies && yarn test:unit", |
| 55 | + "test:policies": "yarn test:deps && yarn test:schemas && yarn test:lint && yarn test:cycles", |
55 | 56 | "test:deps": "node -e \"import('./package.json', { assert: { type: 'json' } }).then(p => typeof p.dependencies === 'undefined' ? console.log('No dependencies found.') : (console.error('Dependencies are not allowed.') && process.exit(1)));\"", |
56 | 57 | "test:schemas:unchanged": "yarn gen:schema && node -e \"child_process.exec('git status src/lib/schema --porcelain | head -c1 | wc -c', (err, stdout) => stdout.trim() === '0' ? process.exit(0) : process.exit(1) )\"", |
57 | 58 | "test:schemas": "yarn test:schemas:unchanged && echo \"Schemas are up to date.\" || echo \"Error: one or more schemas are outdated. Please review and commit the changes in src/lib/schema.\"", |
|
61 | 62 | "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"", |
62 | 63 | "test:cycles": "madge --circular build/index.js", |
63 | 64 | "test:unit": "c8 ava", |
| 65 | + "test:fast": "echo '\n\nUsage:\n yarn test:fast src/lib/key/bip39.spec.ts # run a single test file \n yarn test:fast --match=\"!*crypto*\" --match=\"!*vmb_tests*\" # include/exclude tests with names matching pattern(s) \n\n' && ava -v", |
64 | 66 | "test:unit:script_tests": "c8 ava --match='*[script_tests]*' --serial", |
65 | 67 | "test:unit:vmb_tests": "c8 ava src/lib/vmb-tests/bch-vmb-tests.spec.ts --serial", |
66 | 68 | "test:unit:vmb_test": "node 'build/lib/vmb-tests/bch-vmb-test.spec.helper.js'", |
|
69 | 71 | "bench:test": "ava --config .ava.bench.config.js --serial --timeout=2m 2>&1 | tee bench.log", |
70 | 72 | "bench:browser-deps": "cpy '.yarn/artifacts/*.js' build/bench", |
71 | 73 | "watch": "yarn build -w", |
72 | | - "watch:test": "echo 'Usage: yarn watch:test --match=\"*pattern*\"' && ava -v --watch", |
| 74 | + "watch:test": "echo '\n\nUsage:\n yarn watch:test src/lib/key/bip39.spec.ts # watch a single test file \n yarn watch:test --match=\"!*crypto*\" --match=\"!*vmb_tests*\" # include/exclude tests with names matching pattern(s) \n\n' && ava -v --watch", |
73 | 75 | "cov": "yarn build && yarn test:unit && yarn cov:html && yarn cov:lcov && open-cli coverage/index.html", |
74 | 76 | "cov:html": "c8 report --reporter=html", |
75 | 77 | "cov:lcov": "c8 report --reporter=lcov", |
|
107 | 109 | "ajv-cli": "^5.0.0", |
108 | 110 | "asmcrypto.js": "^2.3.2", |
109 | 111 | "ava": "^6.0.1", |
| 112 | + "bip39": "^3.1.0", |
110 | 113 | "bitcore-lib-cash": "^10.0.23", |
111 | 114 | "c8": "^9.0.0", |
112 | 115 | "chuhai": "^1.2.0", |
|
147 | 150 | "SECURITY.md" |
148 | 151 | ], |
149 | 152 | "ava": { |
150 | | - "timeout": "20s", |
| 153 | + "timeout": "60s", |
151 | 154 | "typescript": { |
152 | 155 | "compile": false, |
153 | 156 | "rewritePaths": { |
154 | 157 | "src/": "build/" |
155 | 158 | } |
156 | 159 | }, |
157 | 160 | "nodeArguments": [ |
158 | | - "--experimental-json-modules" |
159 | | - ], |
160 | | - "workerThreads": false |
| 161 | + "--experimental-json-modules", |
| 162 | + "--experimental-global-webcrypto", |
| 163 | + "# ^ needed for node v18" |
| 164 | + ] |
161 | 165 | }, |
162 | 166 | "config": { |
163 | 167 | "commitizen": { |
|
198 | 202 | "**/*.bench.js", |
199 | 203 | "**/*.spec.js", |
200 | 204 | "**/*.spec.helper.js", |
201 | | - ".pnp.*" |
| 205 | + ".pnp.*", |
| 206 | + "**/ajv/validate-*.js" |
202 | 207 | ] |
203 | 208 | }, |
204 | 209 | "sideEffects": false, |
|
0 commit comments