Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
test: added tests about the import syntax
Browse files Browse the repository at this point in the history
Added missing tests about using the import syntax
  • Loading branch information
adriantoine committed Mar 1, 2016
1 parent 66e120e commit a57d4bb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/fixtures/import.expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var _a = require('../assets/le-test-lib/this/is/a.js');

var _a2 = _interopRequireDefault(_a);

require('../assets/le-test-lib/b.less');

require('../assets/le-test-lib/and/a/file.css');

var _myRelativeTestLib = require('../assets/le-test-lib');

var _myRelativeTestLib2 = _interopRequireDefault(_myRelativeTestLib);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9 changes: 9 additions & 0 deletions test/fixtures/import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

import'my-relative-test-lib/this/is/a.js';
import'my-relative-test-lib/b.less';
import'my-relative-test-lib/and/a/file.css';

import test from 'my-relative-test-lib/this/is/a.js';
import test2 from 'my-relative-test-lib';

// Rest of the file
8 changes: 8 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ test('requiring files from the root', t => {
const expected = read('fixtures/rootfolder.expected.js');
t.is(actual, expected);
});


test('using the import syntax', t => {
const actual = transformFile('fixtures/import.js', {config: './runtime.webpack.config.js'}).code;
const expected = read('fixtures/import.expected.js');

t.is(actual, expected);
});

0 comments on commit a57d4bb

Please # to comment.