Skip to content

Commit

Permalink
Use "multidep" to install "babel-core"
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Mar 27, 2017
1 parent c29677a commit 8d4235b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# dependencies
/node_modules
/bower_components
/node-tests/multidep_modules

# misc
/.sass-cache
Expand Down
6 changes: 6 additions & 0 deletions node-tests/multidep.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"path": "node-tests/multidep_modules",
"versions": {
"babel-core": ["5.8.33"]
}
}
9 changes: 5 additions & 4 deletions node-tests/strip-data-test-properties-plugin-test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
var fs = require('fs');
var assert = require('assert');
var multidepRequire = require('multidep')('node-tests/multidep.json');

var babel = require('babel-core');
var StripDataTestPropertiesPlugin = require('../strip-data-test-properties-plugin');
var babel5 = multidepRequire('babel-core', '5.8.33');
var StripDataTestPropertiesPlugin5 = require('../strip-data-test-properties-plugin');

function testFixture(name) {
it('fixture: ' + name, function() {
var fixturePath = __dirname + '/fixtures/' + name + '/fixture.js';
var expectedPath = __dirname + '/fixtures/' + name + '/expected.js';

var expected = fs.readFileSync(expectedPath).toString();
var result = babel.transformFileSync(fixturePath, {
plugins: [StripDataTestPropertiesPlugin],
var result = babel5.transformFileSync(fixturePath, {
plugins: [StripDataTestPropertiesPlugin5],
});

assert.strictEqual(result.code.trim(), expected.trim());
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"test": "npm run test:keep && npm run test:strip",
"test:all": "ember try:each",
"test:keep": "ember test",
"pretest:node": "multidep node-tests/multidep.json",
"test:node": "mocha node-tests",
"test:strip": "STRIP_TEST_SELECTORS=true ember test"
},
Expand Down Expand Up @@ -48,7 +49,8 @@
"eslint-plugin-ember": "^3.0.1",
"eslint-plugin-qunit": "^2.3.0",
"loader.js": "^4.0.10",
"mocha": "^3.2.0"
"mocha": "^3.2.0",
"multidep": "^2.0.2"
},
"engines": {
"node": ">= 4"
Expand Down

0 comments on commit 8d4235b

Please sign in to comment.