Skip to content

Commit

Permalink
Add initial testing infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Stiles committed Jan 22, 2017
1 parent b3d89e9 commit 5fe7055
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -1,2 +1,7 @@
build/
*.zip

node_modules/

# Test output
spec/**/*.xml
9 changes: 8 additions & 1 deletion Makefile
@@ -1,4 +1,4 @@
.PHONY: clean package
.PHONY: clean package test

SHELL := /bin/bash

Expand Down Expand Up @@ -43,3 +43,10 @@ $(BUILD_DIR):

clean:
rm -f deluminate*.zip
find spec -name 'junit*.xml' -exec rm -f {} +

test: node_modules
npm test

node_modules: package.json
npm install
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.7.4",
"description": "Invert the luminance of a website to make it easier on the eyes.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jasmine"
},
"repository": {
"type": "git",
Expand All @@ -22,5 +22,9 @@
"bugs": {
"url": "https://github.com/abstiles/deluminate/issues"
},
"homepage": "https://deluminate.github.io"
"homepage": "https://deluminate.github.io",
"devDependencies": {
"jasmine": "^2.5.3",
"jasmine-reporters": "^2.2.0"
}
}
5 changes: 5 additions & 0 deletions spec/common.spec.js
@@ -0,0 +1,5 @@
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});
7 changes: 7 additions & 0 deletions spec/helpers/setup.js
@@ -0,0 +1,7 @@
const path = require('path')
var reporters = require('jasmine-reporters');
var junitReporter = new reporters.JUnitXmlReporter({
savePath: path.join(__dirname, '..', 'junitresults'),
consolidateAll: false
});
jasmine.getEnv().addReporter(junitReporter);
11 changes: 11 additions & 0 deletions spec/support/jasmine.json
@@ -0,0 +1,11 @@
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}

0 comments on commit 5fe7055

Please sign in to comment.