Skip to content

Commit

Permalink
fix(ava-xs): anchor match patterns
Browse files Browse the repository at this point in the history
 - style: make esmRequire look more like require for dev tools
 - prune some debug logging
  • Loading branch information
dckc committed Mar 16, 2021
1 parent bc36651 commit c753779
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/xsnap/src/ava-xs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const { promises } = require('fs');
const path = require('path');
const glob = require('glob');

esmRequire('@agoric/install-ses');
const bundleSource = esmRequire('@agoric/bundle-source').default;
// eslint-disable-next-line no-global-assign
require = esmRequire; // help vs-code navigate
require('@agoric/install-ses');
const bundleSource = require('@agoric/bundle-source').default;

const { main, makeBundleResolve } = esmRequire('./avaXS');
const { main, makeBundleResolve } = require('./avaXS');

Promise.resolve()
.then(_ =>
Expand Down
4 changes: 2 additions & 2 deletions packages/xsnap/src/avaAssertXS.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ function test(label, run, htestOpt) {
const out = tapFormat(htest.send);
const t = makeTester(htest, out);
try {
out.diagnostic('start', label);
// out.diagnostic('start', label);
await run(t);
out.diagnostic('end', label);
// out.diagnostic('end', label);
} catch (ex) {
console.log('FAIL (todo route console)', ex);
t.fail(`${label} threw: ${ex.message}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/xsnap/src/avaXS.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const { keys } = Object;
* @param {string} pattern
*/
function isMatch(specimen, pattern) {
return specimen.match(pattern.replace(/\*/g, '.*'));
return specimen.match(`^${pattern.replace(/\*/g, '.*')}$`);
}

/**
Expand Down

0 comments on commit c753779

Please sign in to comment.