Permalink
Browse files

Simplify build setup

  • Loading branch information...
1 parent 3030caf commit c720e73236bb0f4c043e8573f96b1dc08df95d5c @brycekahle brycekahle committed Jan 22, 2017
Showing with 22 additions and 34 deletions.
  1. +1 −1 .travis.yml
  2. +0 −29 Makefile
  3. +1 −1 README.md
  4. +16 −0 build.sh
  5. +4 −3 package.json
View
@@ -2,7 +2,7 @@ language: node_js
git:
depth: 1
script:
- - '[ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && npm test || false'
+ - ./build.sh
env:
global:
- secure: L36j3mbU1U2FiOhxYZrTZ7apVnb56gE+QFixsYyDpCRBrVW0q8WR9LTMJx+aPNdlzhRS5FT4gfInujPTnZeb+EvqEoYwtT+CeNG15XtGkfJDkfBFjBa4IZpJAjIwJB+0kKkZr9R7lQEEgy7H9FvLHY2N2WgdzuG8WZwiVRnkwVw=
View
@@ -1,29 +0,0 @@
-
-testbundle:
- @./node_modules/.bin/gulp testbundle
-
-test:
- @if [ "x$(BROWSER_NAME)" = "x" ]; then make test-node; else make test-zuul; fi
-
-test-node:
- @./node_modules/.bin/mocha \
- tests/node.js
-
-test-zuul: testbundle
- @if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
- ./node_modules/.bin/zuul \
- --browser-name $(BROWSER_NAME) \
- --browser-version $(BROWSER_VERSION) \
- tests/browser.js; \
- else \
- ./node_modules/.bin/zuul \
- --browser-name $(BROWSER_NAME) \
- --browser-version $(BROWSER_VERSION) \
- --browser-platform "$(BROWSER_PLATFORM)" \
- tests/browser.js; \
- fi
-
-test-local: testbundle
- @./node_modules/.bin/zuul --local 9090 -- tests/browser.js
-
-.PHONY: test test-node test-zuul test-local testbundle
View
@@ -294,7 +294,7 @@ Both commands output into the `build` directory.
Once you've compiled the SockJS-client you may want to check if your changes
pass all the tests.
- make test-local
+ npm run test:browser_local
This will start [zuul](https://github.com/defunctzombie/zuul) and a test support server. Open the browser to [http://localhost:9090/_zuul](http://localhost:9090/_zuul) and watch the tests run.
View
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+if [ "x${BROWSER_NAME}" = "x" ]; then
+ npm run lint
+ npm test
+elif [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ]; then
+ npm run test:bundle
+ if [ "x${BROWSER_PLATFORM}" = "x" ]; then
+ ./node_modules/.bin/zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION tests/browser.js
+ else
+ ./node_modules/.bin/zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION --browser-platform "$BROWSER_PLATFORM" tests/browser.js
+ fi
+else
+ exit 1
+fi
View
@@ -63,9 +63,10 @@
"url": "https://github.com/sockjs/sockjs-client.git"
},
"scripts": {
- "test": "make test",
- "test_local": "zuul --local 9090 -- tests/browser.js",
- "zuul": "zuul -- tests/browser.js",
+ "test": "mocha tests/node.js",
+ "test:bundle": "gulp testbundle",
+ "test:browser_local": "npm run test:bundle && zuul --local 9090 -- tests/browser.js",
+ "test:browser_remote": "npm run test:bundle && zuul -- tests/browser.js",
"gulp": "gulp",
"lint": "eslint .",
"version": "gulp stable-release && git add -A dist lib/version.js",

0 comments on commit c720e73

Please sign in to comment.