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
3 changes: 2 additions & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"package-lock.json",
"**/package-lock.json",
"node_modules/**",
"scripts/**"
"scripts/**",
"!test/integration/fixtures/stack-trace.fixture.js"
]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"test-browser": "run-s clean build test-browser:*",
"test-coverage-clean": "rimraf .nyc_output coverage",
"test-coverage-generate": "nyc report --reporter=lcov --reporter=text",
"test-node-run-only": "nyc --no-clean --reporter=json node bin/mocha.js --no-forbid-only",
"test-node-run": "nyc --no-clean --reporter=json node bin/mocha.js --forbid-only",
"test-node-run-only": "cross-env NODE_OPTIONS=--enable-source-maps nyc --no-clean --reporter=json node bin/mocha.js --no-forbid-only",
"test-node-run": "cross-env NODE_OPTIONS=--enable-source-maps nyc --no-clean --reporter=json node bin/mocha.js --forbid-only",
"test-node:integration": "run-s clean build && npm run -s test-node-run -- --parallel --timeout 10000 --slow 3750 \"test/integration/**/*.spec.js\"",
"test-node:integration:watch": "run-s clean build && npm run -s test-node-run -- --parallel --timeout 10000 --slow 3750 \"test/integration/options/watch.spec.js\"",
"test-node:interfaces:bdd": "npm run -s test-node-run -- --ui bdd test/interfaces/bdd.spec",
Expand Down
9 changes: 9 additions & 0 deletions test/integration/fixtures/stack-trace.fixture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

var assert = require('assert');

describe('a suite', function() {
it('should succeed', function() {
assert(false);
});
});
16 changes: 16 additions & 0 deletions test/integration/repo-tooling.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";

const { runMochaJSONAsync } = require("./helpers");

describe("repo tooling", function () {
it("issue-5663: line numbers are wrong in stack traces when running mocha self tests", async function () {
const output = await runMochaJSONAsync("stack-trace.fixture.js");
expect(
output.failures[0].err.stack,
"to contain",
// this file needs to be un-excluded from nyc instrumentation, or else this test would fail to catch any
// issues with nyc instrumentation affecting stack traces.
"stack-trace.fixture.js:7",
);
});
});