Get tests passing again

This commit is contained in:
Michael Jackson
2019-07-09 17:21:25 -07:00
parent 2e3c9ff526
commit f3ecddea47
42 changed files with 309 additions and 305 deletions

View File

@ -1,6 +1,6 @@
import babel from 'babel-core';
import * as babel from '@babel/core';
import unpkgRewrite from '../unpkgRewrite';
import unpkgRewrite from '../unpkgRewrite.js';
const testCases = [
{
@ -66,6 +66,7 @@ const testCases = [
}
];
const origin = 'https://unpkg.com';
const dependencies = {
react: '15.6.1',
'@angular/router': '4.3.5',
@ -75,9 +76,9 @@ const dependencies = {
describe('Rewriting imports/exports', () => {
testCases.forEach(testCase => {
it(`successfully rewrites '${testCase.before}'`, () => {
it(`rewrites '${testCase.before}' => '${testCase.after}'`, () => {
const result = babel.transform(testCase.before, {
plugins: [unpkgRewrite(dependencies)]
plugins: [unpkgRewrite(origin, dependencies)]
});
expect(result.code).toEqual(testCase.after);