Skip to content

Commit

Permalink
chore: update 'spawner' package to use AVA (tests fail)
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Aug 23, 2020
1 parent d629428 commit fe1408e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 38 deletions.
17 changes: 12 additions & 5 deletions packages/spawner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"build": "exit 0",
"test": "tap --no-coverage --jobs=1 --timeout 600 'test/**/test*.js'",
"test": "ava",
"lint-fix": "eslint --fix '**/*.js'",
"lint-check": "eslint '**/*.js'",
"lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.js'",
Expand Down Expand Up @@ -42,10 +42,8 @@
"@agoric/install-metering-and-ses": "^0.1.1",
"@agoric/install-ses": "^0.2.0",
"@agoric/swingset-vat": "^0.6.0",
"esm": "^3.2.25",
"tap": "^14.10.5",
"tape": "^4.11.0",
"tape-promise": "^4.0.0"
"ava": "^3.11.1",
"esm": "^3.2.25"
},
"files": [
"src/",
Expand Down Expand Up @@ -95,5 +93,14 @@
},
"publishConfig": {
"access": "public"
},
"ava": {
"files": [
"test/**/test-*.js"
],
"require": [
"esm"
],
"timeout": "2m"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-metering-and-ses';
import { test } from 'tape-promise/tape';
import test from 'ava';
import path from 'path';
import { buildVatController, loadBasedir } from '@agoric/swingset-vat';

Expand All @@ -22,8 +22,7 @@ const contractMintGolden = [

test.skip('run contractHost Demo --mint', async t => {
const dump = await main('contractHost', ['mint']);
t.deepEquals(dump.log, contractMintGolden);
t.end();
t.deepEqual(dump.log, contractMintGolden);
});

const contractTrivialGolden = [
Expand All @@ -35,14 +34,12 @@ const contractTrivialGolden = [
];
test('run contractHost Demo --trivial', async t => {
const dump = await main('contractHost', ['trivial']);
t.deepEquals(dump.log, contractTrivialGolden);
t.end();
t.deepEqual(dump.log, contractTrivialGolden);
});

test('run contractHost Demo --trivial-oldformat', async t => {
const dump = await main('contractHost', ['trivial-oldformat']);
t.deepEquals(dump.log, contractTrivialGolden);
t.end();
t.deepEqual(dump.log, contractTrivialGolden);
});

const contractExhaustedGolden = [
Expand All @@ -54,8 +51,7 @@ const contractExhaustedGolden = [

test('run contractHost Demo -- exhaust', async t => {
const dump = await main('contractHost', ['exhaust']);
t.deepEquals(dump.log, contractExhaustedGolden);
t.end();
t.deepEqual(dump.log, contractExhaustedGolden);
});

const contractAliceFirstGolden = [
Expand All @@ -66,8 +62,7 @@ const contractAliceFirstGolden = [

test.skip('run contractHost Demo --alice-first', async t => {
const dump = await main('contractHost', ['alice-first']);
t.deepEquals(dump.log, contractAliceFirstGolden);
t.end();
t.deepEqual(dump.log, contractAliceFirstGolden);
});

const contractBobFirstGolden = [
Expand All @@ -88,8 +83,7 @@ const contractBobFirstGolden = [

test.skip('run contractHost Demo --bob-first', async t => {
const dump = await main('contractHost', ['bob-first']);
t.deepEquals(dump.log, contractBobFirstGolden);
t.end();
t.deepEqual(dump.log, contractBobFirstGolden);
});

const contractCoveredCallGolden = [
Expand All @@ -111,8 +105,7 @@ const contractCoveredCallGolden = [

test.skip('run contractHost Demo --covered-call', async t => {
const dump = await main('contractHost', ['covered-call']);
t.deepEquals(dump.log, contractCoveredCallGolden);
t.end();
t.deepEqual(dump.log, contractCoveredCallGolden);
});

const contractCoveredCallSaleGolden = [
Expand Down Expand Up @@ -141,6 +134,5 @@ const contractCoveredCallSaleGolden = [

test.skip('run contractHost Demo --covered-call-sale', async t => {
const dump = await main('contractHost', ['covered-call-sale']);
t.deepEquals(dump.log, contractCoveredCallSaleGolden);
t.end();
t.deepEqual(dump.log, contractCoveredCallSaleGolden);
});
21 changes: 8 additions & 13 deletions packages/spawner/test/swingsetTests/escrow/test-escrow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import { test } from 'tape-promise/tape';
import test from 'ava';
import { buildVatController, loadBasedir } from '@agoric/swingset-vat';
import path from 'path';

Expand All @@ -15,8 +15,7 @@ const escrowGolden = ['starting testEscrowServiceSuccess'];

test('escrow checkUnits w/SES', async t => {
const dump = await main('escrow', ['escrow matches']);
t.deepEquals(dump.log, escrowGolden);
t.end();
t.deepEqual(dump.log, escrowGolden);
});

const escrowMismatchGolden = [
Expand All @@ -26,30 +25,27 @@ const escrowMismatchGolden = [

test.skip('escrow check misMatches w/SES', async t => {
const dump = await main('escrow', ['escrow misMatches']);
t.deepEquals(dump.log, escrowMismatchGolden);
t.end();
t.deepEqual(dump.log, escrowMismatchGolden);
});

const escrowCheckPartialWrongPriceGolden = [
'starting testEscrowServiceCheckPartial wrong price',
'expected wrong price Error: Escrow checkPartialUnits seat: different at top.value: ((a number)) vs ((a number))\nSee console for error data.',
];

test.skip('escrow check partial misMatches w/SES', async t => {
test.skip('escrow check partial price misMatches w/SES', async t => {
const dump = await main('escrow', ['escrow partial price']);
t.deepEquals(dump.log, escrowCheckPartialWrongPriceGolden);
t.end();
t.deepEqual(dump.log, escrowCheckPartialWrongPriceGolden);
});

const escrowCheckPartialWrongStockGolden = [
'starting testEscrowServiceCheckPartial wrong stock',
'expected wrong stock Error: Escrow checkPartialUnits seat: different at top.value: ((a string)) vs ((a string))\nSee console for error data.',
];

test.skip('escrow check partial misMatches w/SES', async t => {
test.skip('escrow check partial stock misMatches w/SES', async t => {
const dump = await main('escrow', ['escrow partial stock']);
t.deepEquals(dump.log, escrowCheckPartialWrongStockGolden);
t.end();
t.deepEqual(dump.log, escrowCheckPartialWrongStockGolden);
});

const escrowCheckPartialWrongSeatGolden = [
Expand All @@ -59,6 +55,5 @@ const escrowCheckPartialWrongSeatGolden = [

test.skip('escrow check partial wrong seat w/SES', async t => {
const dump = await main('escrow', ['escrow partial seat']);
t.deepEquals(dump.log, escrowCheckPartialWrongSeatGolden);
t.end();
t.deepEqual(dump.log, escrowCheckPartialWrongSeatGolden);
});
5 changes: 2 additions & 3 deletions packages/spawner/test/test-function-bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@agoric/install-ses';
import { test } from 'tape-promise/tape';
import test from 'ava';
import { importBundle } from '@agoric/import-bundle';
import { bundleFunction } from './make-function-bundle';

Expand All @@ -17,6 +17,5 @@ test('bundleFunction', async t => {
return 'yes';
},
};
t.equal(ns.default('terms', inviteMaker), 'yes');
t.end();
t.is(ns.default('terms', inviteMaker), 'yes');
});

0 comments on commit fe1408e

Please sign in to comment.