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 12, 2023
1 parent e48fd87 commit bd212a2
Show file tree
Hide file tree
Showing 8 changed files with 58 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,5 @@
import { test } from './prepare-test-env-ava.js';
import { makeEnvironmentCaptor } from '../src/env-options.js';
import { makeEnvironmentCaptor } from '@endo/env-options';

Check failure on line 2 in packages/ses-ava/test/test-env-options.js

View workflow job for this annotation

GitHub Actions / lint (16.x, ubuntu-latest)

`@endo/env-options` import should occur before import of `./prepare-test-env-ava.js`

test('test env options empty env', async t => {
const c1 = new Compartment();
Expand Down
42 changes: 42 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,41 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@endo/env-options@^0.1.4":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-0.1.4.tgz#e516bc3864f00b154944e444fb8996a9a0c23a45"
integrity sha512-Ol8ct0aW8VK1ZaqntnUJfrYT59P6Xn36XPbHzkqQhsYkpudKDn5ILYEwGmSO/Ff+XJjv/pReNI0lhOyyrDa9mg==

"@endo/eventual-send@^0.17.6":
version "0.17.6"
resolved "https://registry.yarnpkg.com/@endo/eventual-send/-/eventual-send-0.17.6.tgz#86719e4e3ff76991c49f6680309dc77dff65fe55"
integrity sha512-73cKY2uiWdzMJn7i284NJyD3K0UKjpksBg/EA2GT8YJa0TgeBczFQIm81vC08itK5gHuDDH2vC5COSGR6hxKIg==
dependencies:
"@endo/env-options" "^0.1.4"

"@endo/far@^0.2.3":
version "0.2.22"
resolved "https://registry.yarnpkg.com/@endo/far/-/far-0.2.22.tgz#fda187289a903ee3f9d6dcc5664ee7fef1994b1f"
integrity sha512-LFOicqyHslKOSk/H5EfGOcw347ftDSwYHARPasnrG4UJOEkcU1ZG5bN/BmfONtcidB776gWZKrV/tNl4WLIlyw==
dependencies:
"@endo/eventual-send" "^0.17.6"
"@endo/pass-style" "^0.1.7"

"@endo/pass-style@^0.1.7":
version "0.1.7"
resolved "https://registry.yarnpkg.com/@endo/pass-style/-/pass-style-0.1.7.tgz#ea22568e8b86fb2d1a14a5fc042374cc0d8e310b"
integrity sha512-dlB62Ptjcy/+iachy7qzAdgIwaU60rE+XLummLRpE2tDSJF2jSFJlVwa/QuGw1KKO7Rt4vog/51sKev3EbJZQg==
dependencies:
"@endo/promise-kit" "^0.2.60"
"@fast-check/ava" "^1.1.5"

"@endo/promise-kit@^0.2.60":
version "0.2.60"
resolved "https://registry.yarnpkg.com/@endo/promise-kit/-/promise-kit-0.2.60.tgz#8012ada06970c7eaf965cd856563b34a1790e163"
integrity sha512-6Zp9BqBbc3ywaG+iLRrQRmO/VLKrMnvsbgOKKPMpjEC3sUlksYA09uaH3GrKZgoGChF8m9bXK8eFW39z7wJNUw==
dependencies:
ses "^0.18.8"

"@es-joy/jsdoccomment@~0.39.4":
version "0.39.4"
resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.39.4.tgz#6b8a62e9b3077027837728818d3c4389a898b392"
Expand Down Expand Up @@ -10960,6 +10995,13 @@ serve-static@^1.12.4:
parseurl "~1.3.3"
send "0.18.0"

ses@^0.18.8:
version "0.18.8"
resolved "https://registry.yarnpkg.com/ses/-/ses-0.18.8.tgz#88036511ac3b3c07e4d82dd8cfc6e5f3788205b6"
integrity sha512-kOH1AhJc6gWDXKURKeU1w7iFUdImAegAljVvBg5EUBgNqjH4bxcEsGVUadVEPtA2PVRMyQp1fiSMDwEZkQNj1g==
dependencies:
"@endo/env-options" "^0.1.4"

set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
Expand Down

0 comments on commit bd212a2

Please sign in to comment.