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
changes/68/334268/5
Michael Krotscheck 7 years ago committed by Vitaly Kramskikh
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() {
}
}

@ -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…
Cancel
Save