-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update 'acorn-eventual-send' package to use AVA for testing
- Loading branch information
Showing
4 changed files
with
42 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import test from 'ava'; | ||
import * as acorn from 'acorn'; | ||
import eventualSend from '..'; | ||
|
||
test('parser', async t => { | ||
const MyParser = acorn.Parser.extend(eventualSend(acorn)); | ||
const parser = src => MyParser.parse(src); | ||
|
||
// FIXME: Compare parse trees. | ||
t.truthy(parser('x ~. p(y, z, q)'), 'post'); | ||
t.truthy(parser('x ~. [i](y, z)'), 'computed post'); | ||
t.truthy(parser('x ~. (y, z)'), 'apply'); | ||
t.truthy(parser('x ~. ()'), 'apply nothing'); | ||
t.truthy(parser('x ~. p'), 'get'); | ||
t.truthy(parser('x ~. [i]'), 'computed get'); | ||
t.truthy(parser('x ~. p = v'), 'put'); | ||
t.truthy(parser('x ~. [i] = v'), 'computed put'); | ||
t.truthy(parser('delete x ~. p'), 'delete'); | ||
t.truthy(parser('delete x ~.[p]'), 'computed delete'); | ||
t.truthy(parser('x~.\n p'), 'no asi'); | ||
t.truthy(parser('x\n /* foo */ ~.p'), 'no asi2'); | ||
t.truthy(parser('x~.p~.()'), 'chained get/post'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
import { test } from 'tape-promise/tape'; | ||
import test from 'ava'; | ||
import { rollup } from 'rollup/dist/rollup.es'; | ||
import * as acorn from 'acorn'; | ||
import eventualSend from '..'; | ||
|
||
test('SwingSet bug', async t => { | ||
try { | ||
const bundle = await rollup({ | ||
input: require.resolve('../encouragementBotCommsWavyDot/bootstrap.js'), | ||
treeshake: false, | ||
external: [], | ||
acornInjectPlugins: [eventualSend(acorn)], | ||
}); | ||
t.ok(bundle); | ||
} catch (e) { | ||
t.isNot(e, e, 'unexpected exception'); | ||
} finally { | ||
t.end(); | ||
} | ||
const bundle = await rollup({ | ||
input: require.resolve('../encouragementBotCommsWavyDot/bootstrap.js'), | ||
treeshake: false, | ||
external: [], | ||
acornInjectPlugins: [eventualSend(acorn)], | ||
}); | ||
t.truthy(bundle); | ||
}); |
This file was deleted.
Oops, something went wrong.