Skip to content

Commit

Permalink
More ses-ava (Agoric#2740)
Browse files Browse the repository at this point in the history
* fix: more ses-ava
  • Loading branch information
erights authored Mar 29, 2021
1 parent 93da720 commit bbb2de8
Show file tree
Hide file tree
Showing 59 changed files with 114 additions and 103 deletions.
5 changes: 3 additions & 2 deletions packages/SwingSet/test/device-plugin/test-device.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require __dirname */
import '@agoric/install-ses';
import test from 'ava';
import { test } from '../../tools/prepare-test-env-ava';

// eslint-disable-next-line import/order
import { initSwingStore } from '@agoric/swing-store-simple';

import {
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/test/test-devices.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* global require */
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/order
import { test } from '../tools/prepare-test-env-ava';

import bundleSource from '@agoric/bundle-source';
import { initSwingStore, getAllState } from '@agoric/swing-store-simple';

Expand Down
8 changes: 7 additions & 1 deletion packages/SwingSet/test/test-message-patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
/* eslint dot-notation: "off" */
/* eslint object-shorthand: "off" */

import '@agoric/install-ses';
// `test.serial` does not yet seem compatible with ses-ava
// See https://github.com/endojs/endo/issues/647
// TODO restore
// import { test } from '../tools/prepare-test-env-ava';
import '../tools/prepare-test-env';
// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';

import path from 'path';
import bundleSource from '@agoric/bundle-source';
import { initSwingStore } from '@agoric/swing-store-simple';
Expand Down
7 changes: 4 additions & 3 deletions packages/agoric-cli/integration-tests/test-workflow.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* global __dirname process setTimeout clearTimeout setInterval clearInterval */
/* eslint-disable import/no-extraneous-dependencies */
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import fs from 'fs';
// eslint-disable-next-line import/no-extraneous-dependencies
import tmp from 'tmp';
import { makePromiseKit } from '@agoric/promise-kit';
import { request } from 'http';
Expand Down
1 change: 1 addition & 0 deletions packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint-fix": "eslint --fix '**/*.{js,jsx}'"
},
"devDependencies": {
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"nyc": "^15.1.0",
"tmp": "^0.1.0"
Expand Down
9 changes: 8 additions & 1 deletion packages/cosmic-swingset/test/test-home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/* global require process */
import '@agoric/install-ses';

// `test.after.always` does not yet seem compatible with ses-ava
// See https://github.com/endojs/endo/issues/647
// TODO restore
// import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';
import '@agoric/swingset-vat/tools/prepare-test-env';
// eslint-disable-next-line import/no-extraneous-dependencies
import test from 'ava';

import bundleSource from '@agoric/bundle-source';
import { Far } from '@agoric/marshal';

Expand Down
5 changes: 1 addition & 4 deletions packages/cosmic-swingset/test/unitTests/test-lib-board.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies

import '@agoric/install-ses';
import test from 'ava';
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { Far } from '@agoric/marshal';
import { makeBoard } from '../../lib/ag-solo/vats/lib-board';
Expand Down
11 changes: 5 additions & 6 deletions packages/cosmic-swingset/test/unitTests/test-name-hub.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@agoric/install-ses';
import test from 'ava';
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { makeNameHubKit } from '../../lib/ag-solo/vats/nameHub';

Expand Down Expand Up @@ -28,7 +27,7 @@ test('makeNameHubKit - reserve and update', async t => {
const { nameAdmin, nameHub } = makeNameHubKit();

await t.throwsAsync(() => nameHub.lookup('hello'), {
message: '"nameKey" not found: (a string)',
message: /"nameKey" not found: .*/,
});

// Try reserving and looking up.
Expand All @@ -52,7 +51,7 @@ test('makeNameHubKit - reserve and delete', async t => {
const { nameAdmin, nameHub } = makeNameHubKit();

await t.throwsAsync(() => nameHub.lookup('goodbye'), {
message: '"nameKey" not found: (a string)',
message: /"nameKey" not found: .*/,
});

nameAdmin.reserve('goodbye');
Expand All @@ -64,11 +63,11 @@ test('makeNameHubKit - reserve and delete', async t => {
t.falsy(lookedUpGoodbye);
nameAdmin.delete('goodbye');
await t.throwsAsync(lookupGoodbyeP, {
message: '"nameKey" not found: (a string)',
message: /"nameKey" not found: .*/,
});
t.truthy(lookedUpGoodbye);

await t.throwsAsync(() => nameHub.lookup('goodbye'), {
message: '"nameKey" not found: (a string)',
message: /"nameKey" not found: .*/,
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava'; // calls lockdown()
import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeIssuerKit } from '@agoric/ertp';
import { makeZoe } from '@agoric/zoe';
Expand Down
2 changes: 1 addition & 1 deletion packages/dapp-svelte-wallet/api/test/test-lib-dehydrate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from '@agoric/zoe/tools/prepare-test-env-ava'; // calls lockdown()
import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { Far } from '@agoric/marshal';

Expand Down
2 changes: 1 addition & 1 deletion packages/dapp-svelte-wallet/api/test/test-lib-wallet.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global require */
// @ts-check
import { test } from '@agoric/zoe/tools/prepare-test-env-ava'; // calls lockdown()
import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

// eslint-disable-next-line import/no-extraneous-dependencies
import bundleSource from '@agoric/bundle-source';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { assertOfferResult } from '../../src/assertOfferResult';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeIssuerKit, MathKind } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeIssuerKit, MathKind } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global require */
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeZoe } from '@agoric/zoe';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global require */
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeZoe } from '@agoric/zoe';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global require */
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeResolvePaths } from '../../src/resolvePath';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global require */
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeResolvePaths } from '../../src/resolvePath';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeIssuerKit } from '@agoric/ertp';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global require */
// @ts-check

import { test } from '@agoric/zoe/tools/prepare-test-env-ava';

import { makeZoe } from '@agoric/zoe';
Expand Down
1 change: 1 addition & 0 deletions packages/eventual-send/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"devDependencies": {
"@agoric/assert": "^0.2.4",
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.7",
"nyc": "^15.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/eventual-send/test/test-deep-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// automated test. Rather, its purpose is just to run it to see what a
// deep stack looks like.

import '@agoric/install-ses';
import test from 'ava';
import { assert } from '@agoric/assert';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { E } from './get-hp';

const { freeze } = Object;
Expand Down
6 changes: 3 additions & 3 deletions packages/eventual-send/test/test-deep-stacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// automated test. Rather, its purpose is just to run it to see what a
// deep stack looks like.

import '@agoric/install-ses';
import test from 'ava';
import { assert } from '@agoric/assert';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { E } from './get-hp';

test('deep-stacks when', t => {
Expand Down
5 changes: 3 additions & 2 deletions packages/eventual-send/test/test-e.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { E, HandledPromise } from './get-hp';

test('E reexports', async t => {
Expand Down
7 changes: 4 additions & 3 deletions packages/eventual-send/test/test-eventual-send.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* global setTimeout */
import '@agoric/install-ses';
import test from 'ava';
import { assert, details as X } from '@agoric/assert';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { HandledPromise } from './get-hp';

const { getPrototypeOf } = Object;
const { details: X } = assert;

if (typeof window !== 'undefined') {
// Let the browser detect when the tests are done.
Expand Down
5 changes: 3 additions & 2 deletions packages/eventual-send/test/test-hp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { HandledPromise } from './get-hp';

test('chained properties', async t => {
Expand Down
5 changes: 3 additions & 2 deletions packages/eventual-send/test/test-thenable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { E, HandledPromise } from './get-hp';

test('E.resolve is always asynchronous', async t => {
Expand Down
1 change: 1 addition & 0 deletions packages/import-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"devDependencies": {
"@agoric/bundle-source": "^1.2.4",
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.5",
"nyc": "^15.1.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/import-bundle/test/test-compartment-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { assert, details as X } from '@agoric/assert';
import { wrapInescapableCompartment } from '../src/compartment-wrapper.js';

Expand Down
1 change: 1 addition & 0 deletions packages/import-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"devDependencies": {
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.25",
"nyc": "^15.1.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/import-manager/test/unitTests/test-importsA.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2019 Agoric, under Apache License 2.0
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import '@agoric/install-ses';
import test from 'ava';
import { makeGoodImportManager } from './goodImports';

test('import num is not empty', t => {
Expand Down
1 change: 1 addition & 0 deletions packages/marshal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"devDependencies": {
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.25",
"nyc": "^15.1.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/marshal/test/test-marshal-justin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { makeMarshal, Remotable } from '../src/marshal';
import { decodeToJustin } from '../src/marshal-justin';

Expand Down
5 changes: 3 additions & 2 deletions packages/marshal/test/test-marshal-stringify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { Far } from '../src/marshal';
import { stringify, parse } from '../src/marshal-stringify';
import { roundTripPairs } from './test-marshal';
Expand Down
5 changes: 3 additions & 2 deletions packages/marshal/test/test-marshal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import {
Remotable,
Far,
Expand Down
1 change: 1 addition & 0 deletions packages/notifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"devDependencies": {
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.25",
"nyc": "^15.1.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/notifier/test/test-notifier-adaptor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import {
makeAsyncIterableFromNotifier,
makeNotifierFromAsyncIterable,
Expand Down
1 change: 1 addition & 0 deletions packages/registrar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
},
"devDependencies": {
"@agoric/install-ses": "^0.5.4",
"@agoric/swingset-vat": "^0.14.0",
"ava": "^3.12.1",
"esm": "^3.2.25",
"nyc": "^15.1.0"
Expand Down
5 changes: 3 additions & 2 deletions packages/registrar/test/unitTests/test-registrar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import { makeRegistrar } from '../../src/registrar';

test('Registrar operations', async t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* global __dirname */
import '@agoric/install-ses';
import test from 'ava';
// eslint-disable-next-line import/no-extraneous-dependencies
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava';

import path from 'path';
// eslint-disable-next-line import/no-extraneous-dependencies
import { buildVatController, loadBasedir } from '@agoric/swingset-vat';

async function main(basedir, argv) {
Expand Down
Loading

0 comments on commit bbb2de8

Please sign in to comment.