Skip to content

Commit

Permalink
Adding build sript and npm script for running tests in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipskevin committed Nov 10, 2016
1 parent 91b805c commit 43dba3e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
"version": "git commit -am \"Update dist for release\" && git checkout -b release && git add -f dist/",
"postversion": "git push --tags && git checkout master && git branch -D release && git push",
"testee": "testee test/index.html --browsers firefox",
"testee-production": "testee test/production.html --browsers firefox",
"http-server": "http-server -p 3000 --silent",
"test": "npm run build && npm run testee",
"test": "npm run test-development && npm run test-production ",
"test-development": "npm run build && npm run testee",
"test-production": "npm run build && npm run build-tests && npm run testee-production",
"ci": "npm run build && node test/test-sauce-labs.js",
"release:pre": "npm version prerelease && npm run build && npm publish",
"release:patch": "npm version patch && npm run build && npm publish",
"release:minor": "npm version minor && npm run build && npm publish",
"release:major": "npm version major && npm run build && npm publish",
"build": "node build.js",
"build-tests": "node test/build.js",
"document": "bit-docs"
},
"title": "CanJS",
Expand Down Expand Up @@ -58,7 +62,7 @@
"can-set": "1.0.1",
"can-simple-dom": "1.0.2",
"can-simple-map": "3.0.0",
"can-stache": "3.0.6",
"can-stache": "3.0.7",
"can-stache-bindings": "3.0.4",
"can-stache-converters": "3.0.3",
"can-stream": "0.0.5",
Expand Down
10 changes: 10 additions & 0 deletions test/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var stealTools = require("steal-tools");

stealTools.build({
main: "can/test/test",
config: __dirname + "/../package.json!npm"
},{
minify: false,
debug: true,
bundleAssets: true
});
8 changes: 5 additions & 3 deletions test/integration/all/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var makeIframe = function(src){

QUnit.module('can.all.js');

QUnit.asyncTest("works without jquery", function(){
makeIframe(__dirname + "/no-jquery.html?" + Math.random());
});
if (__dirname !== '/') {
QUnit.asyncTest("works without jquery", function(){
makeIframe(__dirname + "/no-jquery.html?" + Math.random());
});
}
5 changes: 5 additions & 0 deletions test/production.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<title>CanJS production tests</title>
<iframe src="../docs/can-guides/experiment/todomvc/todomvc.html" name="todo"></iframe>
<script src="../dist/node_modules/steal/steal.production.js" main="can/test/test"></script>
<div id="qunit-fixture"></div>
4 changes: 3 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ require('../view/node_lists/node_lists_test');
require('../view/parser/parser_test');
require('../view/scope/scope_test');
require('../view/autorender/autorender_test');
require('can-simple-map/can-simple-map_test');
if (!System.isEnv('production')) {
System.import('can-simple-map/can-simple-map_test');
}
require('can-view-target/test/test');
require('can-simple-dom/test/test');

Expand Down

0 comments on commit 43dba3e

Please sign in to comment.