Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM node:0.10-slim
FROM node:10.3.0-alpine

RUN npm config set unsafe-perm true
RUN npm install -g mocha
RUN npm install -g istanbul
RUN npm install -g gulp

COPY ./package.json /src/package.json
RUN cd /src && npm install
COPY ./ /src

WORKDIR /src
#ENV DEBUG=*


CMD ["npm", "start"]
3 changes: 3 additions & 0 deletions app/tests/room.unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ describe('entity tests', function(){
it('create user', function(done){
done();
})
it('should ', (done) => {
done()
});
})
5 changes: 5 additions & 0 deletions app/tests/test.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('test', function(){
it('test ', (done) => {
done()
});
})
10 changes: 10 additions & 0 deletions coverage/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p>Report</p>
</body>
</html>
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#this is an example of a self-hosted chat app.
#the composition uses just mongo as a database and an image that was built from a demo application https://github.com/containers101/demochat

Expand Down
16 changes: 8 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
// var istanbul = require('gulp-istanbul');
// We'll use mocha in this example, but any test framework will work
var mocha = require('gulp-mocha');
var debug = require('gulp-debug');

gulp.task('pre-test', function () {
return gulp.src(['app/**/*.js','!app/tests/**/*.spec.js'])
/*gulp.task('pre-test', function () {
return gulp.src(['app/!**!/!*.js','!app/tests/!**!/!*.spec.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
.pipe(istanbul.hookRequire());
});
});*/

gulp.task('test', ['pre-test'], function () {
gulp.task('test', function () {
console.log('test task')
return gulp.src(['app/tests/*.js'])
.pipe(debug({title: 'unicorn:'}))
.pipe(mocha({timeout:10000}))
// .pipe(debug({title: 'unicorn:'}))
.pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) // mocha-allure-reporter , mochawesome
// Creating the reports after tests ran
.pipe(istanbul.writeReports())
// .pipe(istanbul.writeReports())
// Enforce a coverage of at least 90%
//.pipe(istanbul.enforceThresholds({ thresholds: { global: 20} }));
});
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"stop": "pkill --signal SIGINT letschat",
"prestart": "migroose",
"migrate": "migroose",
"test": "mocha ./app/tests"
"test": "gulp test"
},
"engine": {
"node": "0.10.x",
Expand Down Expand Up @@ -80,6 +80,7 @@
"md5": "^2.0.0",
"migroose": "^0.5.0",
"migroose-cli": "^0.1.0",
"mocha-allure-reporter": "^1.4.0",
"moment": "^2.10.6",
"mongoose": "~4.1.8",
"mongoose-unique-validator": "~0.4.1",
Expand All @@ -89,6 +90,7 @@
"node-xmpp-server": "2.1.0",
"node_hash": "^0.2.0",
"nunjucks": "^1.3.4",
"nyc": "^13.1.0",
"on-finished": "^2.3.0",
"passport": "0.2.2",
"passport-http": "0.2.2",
Expand All @@ -109,6 +111,7 @@
"gulp-mocha": "^2.2.0",
"istanbul": "^0.4.2",
"mocha": "^2.3.4",
"mochawesome": "^3.0.3",
"shortid": "^2.2.4"
}
}