Skip to content

Commit

Permalink
Merge pull request #921 from stealjs/fix-cli-test
Browse files Browse the repository at this point in the history
Fix export cli test
  • Loading branch information
m-mujica authored Jan 11, 2018
2 parents 26f1f18 + cb0d28a commit a07fc73
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 56 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"pdenodeify": "^0.1.0",
"prettier": "1.9.2",
"pump": "^1.0.2",
"steal": "^1.5.13",
"steal-bundler": "^0.3.5",
"steal-parse-amd": "^1.0.0",
"through2": "^2.0.0",
Expand Down Expand Up @@ -57,7 +56,10 @@
"mockery": "^2.0.0",
"rimraf": "^2.6.2",
"serve-static": "^1.12.6",
"steal": "^1.6.4",
"steal-conditional": "^0.4.0",
"steal-css": "^1.3.1",
"steal-less": "^1.2.2",
"steal-qunit": "^1.0.0",
"testee": "^0.7.0",
"tree-kill": "^1.2.0",
Expand Down
7 changes: 5 additions & 2 deletions test/pluginifier_builder_helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
"version": "0.5.0-pre.2",
"dependencies": {
"jquery": ">2.0",
"cssify": "^0.6.0"
"cssify": "^0.6.0",
"steal-css": "^1.3.1",
"steal-less": "^1.2.2"
},
"system": {
"steal": {
"plugins": ["steal-less"],
"directories": {
"lib" : "src"
}
Expand Down
68 changes: 15 additions & 53 deletions test/test_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ describe("steal-tools cli", function () {
});

it("only outputs +cjs", function() {
assert(fs.existsSync(path.join(distPath, "cjs")),
"it should output cjs build");

assert(!fs.existsSync(path.join(distPath, "amd")),
"it should not output amd");

Expand Down Expand Up @@ -305,66 +308,25 @@ describe("steal-tools cli", function () {
path.join(destModulesPath, "cssify")
);
})
.then(function() {
return pcopy(
path.join(srcModulesPath, "steal-less"),
path.join(destModulesPath, "steal-less")
);
})
.then(function() {
return pcopy(
path.join(srcModulesPath, "steal-css"),
path.join(destModulesPath, "steal-css")
);
})
.then(function() {
done();
})
.catch(function(error) {
done(error);
});
}

function testCJS(done) {
var browserify = require("browserify")();

browserify.add(path.join(
__dirname,
"pluginifier_builder_helpers/browserify.js"
));

var out = fs.createWriteStream(path.join(
__dirname,
"pluginifier_builder_helpers/browserify-out.js"
));

browserify.bundle()
.on("error", done)
.pipe(out);

out.on("error", done);

out.on("finish", function() {
var page = "test/pluginifier_builder_helpers/browserify.html";

open(page, function(browser, close) {
find(browser,"WIDTH", function(width) {
assert.equal(width, 200, "with of element");
close();
}, close);
}, done);
});
}

function testAMD(done) {
var page = "test/pluginifier_builder_helpers/amd.html";

open(page, function(browser, close) {
find(browser, "WIDTH", function(width) {
assert.equal(width, 200, "with of element");
close();
}, close);
}, done);
}

function testGlobal(done) {
var page = "test/pluginifier_builder_helpers/global.html";

open(page, function(browser, close) {
find(browser,"WIDTH", function() {
assert.ok(browser.window.TABS, "got tabs");
close();
}, close);
}, done);
}
});

describe("optimize", function() {
Expand Down

0 comments on commit a07fc73

Please sign in to comment.