-
Notifications
You must be signed in to change notification settings - Fork 0
/
.test.env
31 lines (28 loc) · 997 Bytes
/
.test.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
NODE_ENV=test
NODE_OPTIONS="--loader ts-node/esm --enable-source-maps --no-warnings"
# If you need a global setup file, you can use the following node options:
# NODE_OPTIONS="--loader ts-node/esm --no-warnings --import ./test/setup.ts"
# file: test/setup.ts
# ```ts
# import { after, before } from 'node:test';
# import chai from 'chai';
# import chaiAsPromised from 'chai-as-promised';
#
# // Extend Chai with chai-as-promised
# chai.use(chaiAsPromised);
#
# before(() => {
# // Do something before all tests
# });
#
# after(() => {
# // Do something after all tests
# });
# ```
# The `--experimental-test-isolation=none` flag can't be used in NODE_OPTIONS
# You'll probably also need to update the isolation-mode in your test script,
# othwerwise the setup will run once for each test file, instead of once for all tests,
# and any shared state will be reset between each test file.
#
# "test": "node --env-file .test.env --experimental-test-isolation=none --test 'src/**/*.test.ts'",
#