Skip to content

Commit

Permalink
refactor(env-options): migrate test to reduce cyclic dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Dec 19, 2023
1 parent 94472c4 commit 75e7dd6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
5 changes: 5 additions & 0 deletions packages/env-options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ if (capturedEnvironmentOptionNames.length > 0) {
);
}
```

# Note of test migration

To reduce cyclic dependencies, the tests of this module have been moved to
@endo/ses-ava. Doing `yarn test` here currently does nothing.
4 changes: 1 addition & 3 deletions packages/env-options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
"lint:types": "tsc",
"build:types": "tsc --build tsconfig.build.json",
"clean:types": "git clean -f '*.d.ts*'",
"test": "ava"
"test": "exit 0"
},
"devDependencies": {
"@endo/init": "^1.0.0",
"@endo/ses-ava": "^1.0.0",
"ava": "^5.3.0",
"babel-eslint": "^10.0.3",
"eslint": "^8.46.0",
Expand Down
9 changes: 0 additions & 9 deletions packages/env-options/test/prepare-test-env-ava.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/lockdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"lint-fix": "eslint --fix '**/*.js'",
"lint": "eslint '**/*.js'"
},
"devDependencies": {
"ava": "^5.1.1"
},
"dependencies": {
"ses": "^1.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/ses-ava/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"ses": "^1.0.0"
},
"devDependencies": {
"@endo/env-options": "^1.0.0",
"@endo/lockdown": "^1.0.0",
"ava": "^5.3.0",
"babel-eslint": "^10.0.3",
"c8": "^7.14.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/ses-ava/test/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import '@endo/lockdown/commit-debug.js';

import rawTest from 'ava';
import { wrapTest } from '../src/ses-ava-test.js';

/** @type {typeof rawTest} */
export const test = wrapTest(rawTest);
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { test } from './prepare-test-env-ava.js';
import { makeEnvironmentCaptor } from '../src/env-options.js';

// eslint-disable-next-line import/order
import { makeEnvironmentCaptor } from '@endo/env-options';

test('test env options empty env', async t => {
const c1 = new Compartment();
Expand Down

0 comments on commit 75e7dd6

Please sign in to comment.