Added jasmine-based testing harness.
This patch adds jasmine-based testing harnesses for node tests. A dummy test has also been added to demonstrate use of ES6 features. Change-Id: I6d7249ba0224107f79a453eff0676e1c49424eb6
This commit is contained in:
parent
effd5b100c
commit
9877477cef
|
@ -4,3 +4,4 @@ node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
package
|
package
|
||||||
doc
|
doc
|
||||||
|
cover
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
"description": "JavaScript API library for OpenStack.",
|
"description": "JavaScript API library for OpenStack.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pretest": "npm run build",
|
"test": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
|
||||||
"test": "exit 0",
|
|
||||||
"lint": "eslint ./",
|
"lint": "eslint ./",
|
||||||
"prepublish": "nsp check; npm run build",
|
"prepublish": "nsp check; npm run build",
|
||||||
"build": "babel src -d dist",
|
"build": "babel src -d dist",
|
||||||
|
@ -32,6 +31,7 @@
|
||||||
"babel-register": "^6.9.0",
|
"babel-register": "^6.9.0",
|
||||||
"eslint": "^2.4.0",
|
"eslint": "^2.4.0",
|
||||||
"eslint-config-openstack": "2.0.0",
|
"eslint-config-openstack": "2.0.0",
|
||||||
|
"jasmine": "^2.4.1",
|
||||||
"nsp": "^2.4.0"
|
"nsp": "^2.4.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -2,3 +2,8 @@ import 'babel-polyfill';
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
|
|
||||||
log.setLevel('INFO');
|
log.setLevel('INFO');
|
||||||
|
|
||||||
|
export default class Test {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import Test from "../../src/index.js";
|
||||||
|
|
||||||
|
describe("Simple test", () => {
|
||||||
|
it("should export a class", () => {
|
||||||
|
var t = new Test();
|
||||||
|
expect(t).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"spec_dir": "test/unit",
|
||||||
|
"spec_files": [
|
||||||
|
"**/*[tT]est.js"
|
||||||
|
],
|
||||||
|
"helpers": [
|
||||||
|
"../../node_modules/babel-register/lib/node.js"
|
||||||
|
],
|
||||||
|
"stopSpecOnExpectationFailure": false,
|
||||||
|
"random": false
|
||||||
|
}
|
Loading…
Reference in New Issue