Skip to content

Commit

Permalink
Breaking: Switch from 6to5 to babel using the .babel.js extension
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jan 3, 2019
1 parent eb9f26d commit a6711f9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
},
"dependencies": {
"resolve": "^0.6.1",
"interpret": "^0.4.0"
"interpret": "^0.5.0"
},
"devDependencies": {
"6to5": "^2.9.4",
"babel": "^4.1.1",
"LiveScript": "^1.2.0",
"chai": "^1.9.0",
"coco": "^0.9.1",
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions test/fixtures/test.es6

This file was deleted.

29 changes: 21 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@ var expected = {
};

describe('registerFor', function () {
var original;

beforeEach(function () {
// save the original require.extensions
var keys = Object.keys(require.extensions);
original = keys.reduce(function(result, key){
result[key] = require.extensions[key];
return result;
}, {});
});

afterEach(function () {
// restore the original require.extensions
require.extensions = original;
original = null;
});

it('should know babel.js', function () {
rechoir.registerFor('./test/fixtures/test.babel.js');
expect(require('./fixtures/test.babel.js')).to.deep.equal(expected);
});
it('should know coco', function () {
rechoir.registerFor('./test/fixtures/test.co');
expect(require('./fixtures/test.co')).to.deep.equal(expected);
Expand Down Expand Up @@ -53,14 +74,6 @@ describe('registerFor', function () {
rechoir.registerFor('./test/fixtures/test.jsx');
expect(require('./fixtures/test.jsx')).to.deep.equal(expected);
});
it('should know es6', function () {
rechoir.registerFor('./test/fixtures/test.es6');
expect(require('./fixtures/test.es6')).to.deep.equal(expected);
});
it('should also register on .es', function () {
rechoir.registerFor('./test/fixtures/test.es');
expect(require('./fixtures/test.es')).to.deep.equal(expected);
});
it('should know livescript', function () {
rechoir.registerFor('./test/fixtures/test.ls');
expect(require('./fixtures/test.ls')).to.deep.equal(expected);
Expand Down

0 comments on commit a6711f9

Please sign in to comment.