Skip to content

Commit

Permalink
add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 16, 2022
1 parent cf1dfc8 commit 97417b2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/compat-tools/compat.mjs
@@ -1,4 +1,4 @@
import { deepEqual } from 'assert/strict';
import { deepEqual, ok } from 'assert/strict';
import compat from 'core-js-compat/compat.js';

deepEqual(compat({
Expand Down Expand Up @@ -119,4 +119,15 @@ deepEqual(compat({
},
}, 'some targets');

const { list: inverted1 } = compat({ targets: { esmodules: true }, inverse: true });

ok(inverted1.includes('es.symbol.iterator'), 'inverse #1');
ok(!inverted1.includes('esnext.iterator.from'), 'inverse #2');
ok(!inverted1.includes('esnext.array.at'), 'inverse #3');

const { list: inverted2 } = compat({ modules: 'core-js/es/math', targets: { esmodules: true }, inverse: true });

ok(inverted2.includes('es.math.acosh'), 'inverse #4');
ok(!inverted2.includes('es.map'), 'inverse #5');

echo(chalk.green('compat tool tested'));

0 comments on commit 97417b2

Please sign in to comment.