mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix code coverage
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,3 +48,4 @@ webpack.webstorm.config
|
|||||||
# mongodb replica set for local dev
|
# mongodb replica set for local dev
|
||||||
mongodb-*.tgz
|
mongodb-*.tgz
|
||||||
/mongodb-data
|
/mongodb-data
|
||||||
|
/.nyc_output
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ function runInChildProcess (command, options = {}, envVariables = '') {
|
|||||||
return done => pipe(exec(testBin(command, envVariables), options, done));
|
return done => pipe(exec(testBin(command, envVariables), options, done));
|
||||||
}
|
}
|
||||||
|
|
||||||
function integrationTestCommand (testDir, coverageDir) {
|
function integrationTestCommand (testDir) {
|
||||||
return `istanbul cover --dir coverage/${coverageDir} --report lcovonly node_modules/mocha/bin/_mocha -- ${testDir} --recursive --require ./test/helpers/start-server`;
|
return `nyc --no-clean mocha ${testDir} --recursive --require ./test/helpers/start-server`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test task definitions */
|
/* Test task definitions */
|
||||||
@@ -148,7 +148,7 @@ gulp.task('test:content:safe', gulp.series('test:prepare:build', cb => {
|
|||||||
|
|
||||||
gulp.task(
|
gulp.task(
|
||||||
'test:api:unit:run',
|
'test:api:unit:run',
|
||||||
runInChildProcess(integrationTestCommand('test/api/unit', 'coverage/api-unit')),
|
runInChildProcess(integrationTestCommand('test/api/unit')),
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('test:api:unit:watch', () => gulp.watch(['website/server/libs/*', 'test/api/unit/**/*', 'website/server/controllers/**/*'], gulp.series('test:api:unit:run', done => done())));
|
gulp.task('test:api:unit:watch', () => gulp.watch(['website/server/libs/*', 'test/api/unit/**/*', 'website/server/controllers/**/*'], gulp.series('test:api:unit:run', done => done())));
|
||||||
@@ -156,7 +156,7 @@ gulp.task('test:api:unit:watch', () => gulp.watch(['website/server/libs/*', 'tes
|
|||||||
gulp.task('test:api-v3:integration', gulp.series(
|
gulp.task('test:api-v3:integration', gulp.series(
|
||||||
'test:prepare:mongo',
|
'test:prepare:mongo',
|
||||||
runInChildProcess(
|
runInChildProcess(
|
||||||
integrationTestCommand('test/api/v3/integration', 'coverage/api-v3-integration'),
|
integrationTestCommand('test/api/v3/integration'),
|
||||||
LIMIT_MAX_BUFFER_OPTIONS,
|
LIMIT_MAX_BUFFER_OPTIONS,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
@@ -175,7 +175,7 @@ gulp.task('test:api-v3:integration:separate-server', runInChildProcess(
|
|||||||
gulp.task('test:api-v4:integration', gulp.series(
|
gulp.task('test:api-v4:integration', gulp.series(
|
||||||
'test:prepare:mongo',
|
'test:prepare:mongo',
|
||||||
runInChildProcess(
|
runInChildProcess(
|
||||||
integrationTestCommand('test/api/v4', 'api-v4-integration'),
|
integrationTestCommand('test/api/v4'),
|
||||||
LIMIT_MAX_BUFFER_OPTIONS,
|
LIMIT_MAX_BUFFER_OPTIONS,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
866
package-lock.json
generated
866
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -93,11 +93,11 @@
|
|||||||
"test:api-v3:integration:separate-server": "NODE_ENV=test gulp test:api-v3:integration:separate-server",
|
"test:api-v3:integration:separate-server": "NODE_ENV=test gulp test:api-v3:integration:separate-server",
|
||||||
"test:api-v4:integration": "gulp test:api-v4:integration",
|
"test:api-v4:integration": "gulp test:api-v4:integration",
|
||||||
"test:api-v4:integration:separate-server": "NODE_ENV=test gulp test:api-v4:integration:separate-server",
|
"test:api-v4:integration:separate-server": "NODE_ENV=test gulp test:api-v4:integration:separate-server",
|
||||||
"test:sanity": "istanbul cover --dir coverage/sanity --report lcovonly node_modules/mocha/bin/_mocha -- test/sanity --recursive",
|
"test:sanity": "nyc --silent --no-clean mocha test/sanity --recursive",
|
||||||
"test:common": "istanbul cover --dir coverage/common --report lcovonly node_modules/mocha/bin/_mocha -- test/common --recursive",
|
"test:common": "nyc --silent --no-clean mocha test/common --recursive",
|
||||||
"test:content": "istanbul cover --dir coverage/content --report lcovonly node_modules/mocha/bin/_mocha -- test/content --recursive",
|
"test:content": "nyc --silent --no-clean mocha test/content --recursive",
|
||||||
"test:nodemon": "gulp test:nodemon",
|
"test:nodemon": "gulp test:nodemon",
|
||||||
"coverage": "COVERAGE=true mocha --require register-handlers.js --reporter html-cov > coverage.html; open coverage.html",
|
"coverage": "nyc report --reporter=html --report-dir coverage/results; open coverage.html",
|
||||||
"sprites": "gulp sprites:compile",
|
"sprites": "gulp sprites:compile",
|
||||||
"client:dev": "cd website/client && npm run serve",
|
"client:dev": "cd website/client && npm run serve",
|
||||||
"client:build": "cd website/client && npm run build",
|
"client:build": "cd website/client && npm run build",
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
"chai-moment": "^0.1.0",
|
"chai-moment": "^0.1.0",
|
||||||
"chalk": "^5.3.0",
|
"chalk": "^5.3.0",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"istanbul": "^1.1.0-alpha.1",
|
|
||||||
"mocha": "^5.1.1",
|
"mocha": "^5.1.1",
|
||||||
|
"nyc": "^15.1.0",
|
||||||
"monk": "^7.3.4",
|
"monk": "^7.3.4",
|
||||||
"require-again": "^2.0.0",
|
"require-again": "^2.0.0",
|
||||||
"run-rs": "^0.7.7",
|
"run-rs": "^0.7.7",
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import armoireSet from '../../../website/common/script/content/gear/sets/armoire
|
|||||||
|
|
||||||
describe('armoireSet items', () => {
|
describe('armoireSet items', () => {
|
||||||
it('checks if canOwn has the same id', () => {
|
it('checks if canOwn has the same id', () => {
|
||||||
console.log(armoireSet);
|
|
||||||
Object.keys(armoireSet).forEach(type => {
|
Object.keys(armoireSet).forEach(type => {
|
||||||
Object.keys(armoireSet[type]).forEach(itemKey => {
|
Object.keys(armoireSet[type]).forEach(itemKey => {
|
||||||
const ownedKey = `${type}_armoire_${itemKey}`;
|
const ownedKey = `${type}_armoire_${itemKey}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user