Skip to content

Commit

Permalink
Try to fix codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jan 24, 2019
1 parent 27691d8 commit d859f3a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ language: node_js

# https://github.com/nodejs/Release
node_js:
- '11'
- '11.6'
- '10'
- '8'
- '6'

git:
depth: 5

cache: yarn

notifications:
irc:
use_notice: true
Expand Down
32 changes: 32 additions & 0 deletions async-dump.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

const log = require('why-is-node-running')
// const {createHook} = require('async_hooks');
// const {stackTraceFilter} = require('mocha/lib/utils');
// const allResources = new Map();

// this will pull Mocha internals out of the stacks
// const filterStack = stackTraceFilter();

// const hook = createHook({
// init(asyncId, type, triggerAsyncId) {
// allResources.set(asyncId, {type, triggerAsyncId, stack: (new Error()).stack});
// },
// destroy(asyncId) {
// allResources.delete(asyncId);
// }
// }).enable();

global.asyncDump = module.exports = () => {
//hook.disable();
console.error(`
STUFF STILL IN THE EVENT LOOP:`)
// allResources.forEach(value=> {
// console.error(`Type: ${value.type}`);
// console.error(filterStack(value.stack));
// console.error('\n');
// });
setTimeout(function () {
log() // logs out active handles that are keeping node running
}, 100)
};
4 changes: 4 additions & 0 deletions async-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
after(function () {
global.asyncDump();
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
});
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"test": "npm run lint && npm run check && npm run testonly",
"test:ci": "npm run lint && npm run check && npm run testonly:codecov",
"t": "mocha --require @babel/register --require @babel/polyfill",
"testonly": "mocha --throw-deprecation --require @babel/register --require @babel/polyfill --check-leaks --full-trace --timeout 15000 src/**/__tests__/**/*-test.js",
"testonly": "mocha --require async-dump.js --throw-deprecation --require @babel/register --require @babel/polyfill --check-leaks --full-trace --timeout 15000 --file async-test.js src/**/__tests__/**/*-test.js",
"testonly:cover": "nyc --reporter html --reporter text-summary -- npm run testonly",
"testonly:codecov": "nyc --silent -- npm run testonly && nyc report --reporter text-lcov > coverage.lcov && codecov",
"testonly:codecov": "nyc --cache false --clean --reporter text-summary --reporter json -- npm run testonly && codecov -f coverage/coverage-final.json",
"lint": "eslint --report-unused-disable-directives src || (printf '\\033[33mTry: \\033[7m npm run lint -- --fix \\033[0m\\n' && exit 1)",
"benchmark": "node ./resources/benchmark.js",
"prettier": "prettier --write --list-different 'src/**/*.js'",
Expand Down Expand Up @@ -68,6 +68,7 @@
"mocha": "5.2.0",
"nyc": "13.1.0",
"prettier": "1.16.1",
"sane": "4.0.2"
"sane": "4.0.2",
"why-is-node-running": "^2.0.3"
}
}
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3573,6 +3573,11 @@ sshpk@^1.7.0:
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"

stackback@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b"
integrity sha1-Gsig2Ug4SNFpXkGLbQMaPDzmjjs=

static-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
Expand Down Expand Up @@ -3912,6 +3917,13 @@ which@^1.2.9, which@^1.3.0:
dependencies:
isexe "^2.0.0"

why-is-node-running@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.0.3.tgz#86619c2861405d3509f55268684fc85e7f4ce145"
integrity sha512-XmzbFN2T859avcs5qAsiiK1iu0nUpSUXRgiGsoHPcNijxhIlp1bPQWQk6ANUljDWqBtAbIR2jF1HxR0y2l2kCA==
dependencies:
stackback "0.0.2"

wide-align@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
Expand Down

0 comments on commit d859f3a

Please sign in to comment.