mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Tidy up default grunt task and fixup test break due to reorder
Fixes #1738
This commit is contained in:
parent
7f89a4a26f
commit
bca020bc4d
@ -4,7 +4,7 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- node_js: "10"
|
- node_js: "10"
|
||||||
script:
|
script:
|
||||||
- ./node_modules/.bin/grunt coverage && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
- ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
|
||||||
before_script:
|
before_script:
|
||||||
- npm install -g istanbul coveralls
|
- npm install -g istanbul coveralls
|
||||||
- node_js: "8"
|
- node_js: "8"
|
||||||
|
@ -55,7 +55,7 @@ module.exports = function(grunt) {
|
|||||||
reportFormats: ['lcov','html'],
|
reportFormats: ['lcov','html'],
|
||||||
print: 'both'
|
print: 'both'
|
||||||
},
|
},
|
||||||
all: { src: ['test/**/*_spec.js'] },
|
all: { src: ["test/_spec.js","test/red/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
||||||
core: { src: ["test/_spec.js","test/red/**/*_spec.js"]},
|
core: { src: ["test/_spec.js","test/red/**/*_spec.js"]},
|
||||||
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
||||||
},
|
},
|
||||||
@ -474,7 +474,7 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('default',
|
grunt.registerTask('default',
|
||||||
'Builds editor content then runs code style checks and unit tests on all components',
|
'Builds editor content then runs code style checks and unit tests on all components',
|
||||||
['build','test-core','test-editor','test-nodes']);
|
['build','jshint:editor','mocha_istanbul:all']);
|
||||||
|
|
||||||
grunt.registerTask('test-core',
|
grunt.registerTask('test-core',
|
||||||
'Runs code style check and unit tests on core runtime code',
|
'Runs code style check and unit tests on core runtime code',
|
||||||
|
@ -86,6 +86,10 @@ function init(config) {
|
|||||||
} else {
|
} else {
|
||||||
api.authenticate = authenticate;
|
api.authenticate = authenticate;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
api.get = get;
|
||||||
|
api.authenticate = authenticate;
|
||||||
|
api.default = api.default;
|
||||||
}
|
}
|
||||||
if (config.default) {
|
if (config.default) {
|
||||||
if (typeof config.default === "function") {
|
if (typeof config.default === "function") {
|
||||||
|
@ -194,8 +194,7 @@ describe("api/auth/users", function() {
|
|||||||
it('should fail to return user fred',function(done) {
|
it('should fail to return user fred',function(done) {
|
||||||
Users.get("fred").then(function(userf) {
|
Users.get("fred").then(function(userf) {
|
||||||
try {
|
try {
|
||||||
userf.should.not.have.a.property("username","fred");
|
should.not.exist(userf);
|
||||||
userf.should.not.have.a.property("permissions","*");
|
|
||||||
done();
|
done();
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
done(err);
|
done(err);
|
||||||
@ -212,9 +211,12 @@ describe("api/auth/users", function() {
|
|||||||
default: function() { return("Done"); }
|
default: function() { return("Done"); }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
after(function() {
|
||||||
|
Users.init({});
|
||||||
|
});
|
||||||
describe('#default',function() {
|
describe('#default',function() {
|
||||||
it('handles api.default being a function',function(done) {
|
it('handles api.default being a function',function(done) {
|
||||||
Users.should.have.property('default').which.is.a.Function;
|
Users.should.have.property('default').which.is.a.Function();
|
||||||
(Users.default()).should.equal("Done");
|
(Users.default()).should.equal("Done");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user