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
|
||||
package
|
||||
doc
|
||||
cover
|
||||
|
@ -4,8 +4,7 @@
|
||||
"description": "JavaScript API library for OpenStack.",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"pretest": "npm run build",
|
||||
"test": "exit 0",
|
||||
"test": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
|
||||
"lint": "eslint ./",
|
||||
"prepublish": "nsp check; npm run build",
|
||||
"build": "babel src -d dist",
|
||||
@ -32,6 +31,7 @@
|
||||
"babel-register": "^6.9.0",
|
||||
"eslint": "^2.4.0",
|
||||
"eslint-config-openstack": "2.0.0",
|
||||
"jasmine": "^2.4.1",
|
||||
"nsp": "^2.4.0"
|
||||
},
|
||||
"files": [
|
||||
|
@ -2,3 +2,8 @@ import 'babel-polyfill';
|
||||
import log from 'loglevel';
|
||||
|
||||
log.setLevel('INFO');
|
||||
|
||||
export default class Test {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
8
test/unit/indexTest.js
Normal file
8
test/unit/indexTest.js
Normal file
@ -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();
|
||||
});
|
||||
});
|
11
test/unit/jasmine.json
Normal file
11
test/unit/jasmine.json
Normal file
@ -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
Block a user