From c20e1e5a1a08811643b192d60366b21245aad244 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Sun, 6 Aug 2023 12:09:19 -0700 Subject: [PATCH] refactor(vat-data): use own prepare-test-env-ava.js --- packages/vat-data/package.json | 3 +++ packages/vat-data/test/prepare-test-env-ava.js | 9 +++++++++ packages/vat-data/test/prepare-test-env.js | 1 + .../vat-data/test/{absent.test.js => test-absent.js} | 0 packages/vat-data/test/test-durable-classes.js | 4 ++-- packages/vat-data/test/test-prepare.js | 4 ++-- .../vat-data/test/{present.test.js => test-present.js} | 0 packages/vat-data/test/test-scalar-only-keys.js | 4 ++-- packages/vat-data/test/test-virtual-classes.js | 4 ++-- 9 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 packages/vat-data/test/prepare-test-env-ava.js create mode 100644 packages/vat-data/test/prepare-test-env.js rename packages/vat-data/test/{absent.test.js => test-absent.js} (100%) rename packages/vat-data/test/{present.test.js => test-present.js} (100%) diff --git a/packages/vat-data/package.json b/packages/vat-data/package.json index b824afca2562..3ba8f281db12 100644 --- a/packages/vat-data/package.json +++ b/packages/vat-data/package.json @@ -32,6 +32,9 @@ "ava": { "require": [ "@endo/init/debug.js" + ], + "files": [ + "test/**/test-*.js" ] }, "publishConfig": { diff --git a/packages/vat-data/test/prepare-test-env-ava.js b/packages/vat-data/test/prepare-test-env-ava.js new file mode 100644 index 000000000000..718c306fa121 --- /dev/null +++ b/packages/vat-data/test/prepare-test-env-ava.js @@ -0,0 +1,9 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import './prepare-test-env.js'; + +// eslint-disable-next-line import/no-extraneous-dependencies +import { wrapTest } from '@endo/ses-ava'; +import rawTest from 'ava'; + +/** @type {typeof rawTest} */ +export const test = wrapTest(rawTest); diff --git a/packages/vat-data/test/prepare-test-env.js b/packages/vat-data/test/prepare-test-env.js new file mode 100644 index 000000000000..4252aeaea3c1 --- /dev/null +++ b/packages/vat-data/test/prepare-test-env.js @@ -0,0 +1 @@ +import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; diff --git a/packages/vat-data/test/absent.test.js b/packages/vat-data/test/test-absent.js similarity index 100% rename from packages/vat-data/test/absent.test.js rename to packages/vat-data/test/test-absent.js diff --git a/packages/vat-data/test/test-durable-classes.js b/packages/vat-data/test/test-durable-classes.js index 65e06ce45036..b79d35097f09 100644 --- a/packages/vat-data/test/test-durable-classes.js +++ b/packages/vat-data/test/test-durable-classes.js @@ -1,8 +1,8 @@ // Modeled on test-heap-classes.js -import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; +import { test } from './prepare-test-env-ava.js'; -import test from 'ava'; +// eslint-disable-next-line import/order import { M } from '@agoric/store'; import { makeKindHandle, diff --git a/packages/vat-data/test/test-prepare.js b/packages/vat-data/test/test-prepare.js index 15d9274efae5..0ddda5e07a25 100644 --- a/packages/vat-data/test/test-prepare.js +++ b/packages/vat-data/test/test-prepare.js @@ -1,8 +1,8 @@ // Modeled on test-heap-classes.js -import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; +import { test } from './prepare-test-env-ava.js'; -import test from 'ava'; +// eslint-disable-next-line import/order import { M } from '@agoric/store'; import { prepareExoClass, diff --git a/packages/vat-data/test/present.test.js b/packages/vat-data/test/test-present.js similarity index 100% rename from packages/vat-data/test/present.test.js rename to packages/vat-data/test/test-present.js diff --git a/packages/vat-data/test/test-scalar-only-keys.js b/packages/vat-data/test/test-scalar-only-keys.js index 3111a5bb1404..e3cebfaf9410 100644 --- a/packages/vat-data/test/test-scalar-only-keys.js +++ b/packages/vat-data/test/test-scalar-only-keys.js @@ -1,8 +1,8 @@ // From https://github.com/Agoric/agoric-sdk/pull/6903#discussion_r1098067133 -import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; +import { test } from './prepare-test-env-ava.js'; -import test from 'ava'; +// eslint-disable-next-line import/order import { M, makeScalarMapStore } from '@agoric/store'; import { makeScalarBigMapStore } from '../src/vat-data-bindings.js'; diff --git a/packages/vat-data/test/test-virtual-classes.js b/packages/vat-data/test/test-virtual-classes.js index 44d2c12c7159..7a0c0e4d84b5 100644 --- a/packages/vat-data/test/test-virtual-classes.js +++ b/packages/vat-data/test/test-virtual-classes.js @@ -1,8 +1,8 @@ // Modeled on test-heap-classes.js -import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; +import { test } from './prepare-test-env-ava.js'; -import test from 'ava'; +// eslint-disable-next-line import/order import { M } from '@agoric/store'; import { defineVirtualExoClass,