diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4fca813e..169e8a1a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,12 @@ // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp // List of extensions which should be recommended for users of this workspace. - "recommendations": ["coenraads.bracket-pair-colorizer-2", "esbenp.prettier-vscode"], + "recommendations": [ + "coenraads.bracket-pair-colorizer-2", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "eg2.vscode-npm-script" + ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 06778c10..e6820e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.3.21] + +### Added + +- `testExplorer.sort`, so I removed my logic. If you want the old ordering set this to `byLabelWithSuitesFirst`. +- tooltip: it will show more info about the suites and tests + ## [2.3.20] - 2019-02-22 ### Fixed diff --git a/README.md b/README.md index 6ee82439..a8e35665 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ and [Google Test](https://github.com/google/googletest) tests using the | `testExplorer.codeLens` | Show a CodeLens above each test or suite for running or debugging the tests. [Details](https://github.com/hbenl/vscode-test-explorer#configuration) | | `testExplorer.onStart` | Retire or reset all test states whenever a test run is started. [Details](https://github.com/hbenl/vscode-test-explorer#configuration) | | `testExplorer.onReload` | Retire or reset all test states whenever the test tree is reloaded. [Details](https://github.com/hbenl/vscode-test-explorer#configuration) | +| `testExplorer.sort` | Sort the tests and suites by label or location. If this is not set (or set to null), they will be shown in the order that they were received from the adapter | + +**Note** that this extension is built upon the Test Explorer +so it's [configuration](https://github.com/hbenl/vscode-test-explorer#configuration) and [commands](https://github.com/hbenl/vscode-test-explorer#commands) can be used. ### catch2TestExplorer.executables diff --git a/package-lock.json b/package-lock.json index a24a1efe..0721aa8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -120,9 +120,9 @@ "dev": true }, "@types/node": { - "version": "10.12.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.26.tgz", - "integrity": "sha512-nMRqS+mL1TOnIJrL6LKJcNZPB8V3eTfRo9FQA2b5gDvrHurC8XbSA86KNe0dShlEL7ReWJv/OU9NL7Z0dnqWTg==", + "version": "10.12.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.27.tgz", + "integrity": "sha512-e9wgeY6gaY21on3ve0xAjgBVjGDWq/xUteK0ujsE53bUoxycMkqfnkUgMt6ffZtykZ5X12Mg3T7Pw4TRCObDKg==", "dev": true }, "@types/request": { @@ -170,32 +170,32 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.4.0.tgz", - "integrity": "sha512-LXLxWdq7nwGrJhMB78EKV+PJw4uWLyQLePRbJjbz6klItPaTa+5zxAr3+GGPaKlhTHKdoCsUaIGfCLjopUA65w==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.4.2.tgz", + "integrity": "sha512-6WInypy/cK4rM1dirKbD5p7iFW28DbSRKT/+PGn+DYzBWEvHq5KnZAqQ5cX25JBc0qMkFxJNxNfBbFXJyyzVcw==", "dev": true, "requires": { - "@typescript-eslint/parser": "1.4.0", - "@typescript-eslint/typescript-estree": "1.4.0", + "@typescript-eslint/parser": "1.4.2", + "@typescript-eslint/typescript-estree": "1.4.2", "requireindex": "^1.2.0", "tsutils": "^3.7.0" } }, "@typescript-eslint/parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.4.0.tgz", - "integrity": "sha512-OvXhpgFCKLxuvoGgtFHQP5gvJvqKGpGjarSPg27E07+OPIcZJ3EpZDdELZuY+0hCA4wqnQ9JzHoTBhdEOMo9Pg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.4.2.tgz", + "integrity": "sha512-OqLkY9295DXXaWToItUv3olO2//rmzh6Th6Sc7YjFFEpEuennsm5zhygLLvHZjPxPlzrQgE8UDaOPurDylaUuw==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "1.4.0", + "@typescript-eslint/typescript-estree": "1.4.2", "eslint-scope": "^4.0.0", "eslint-visitor-keys": "^1.0.0" } }, "@typescript-eslint/typescript-estree": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.4.0.tgz", - "integrity": "sha512-s0Y1/nMSRwIRK+8umAkvUoKsP12Ze8QMAdjVSYLZbrWy8NlsrTLLhpTR5rPEEW7uCnmJtv40kr51PrYAyaJVOw==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.4.2.tgz", + "integrity": "sha512-wKgi/w6k1v3R4b6oDc20cRWro2gBzp0wn6CAeYC8ExJMfvXMfiaXzw2tT9ilxdONaVWMCk7B9fMdjos7bF/CWw==", "dev": true, "requires": { "lodash.unescape": "4.0.1", @@ -3475,9 +3475,9 @@ } }, "vscode-test-adapter-api": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/vscode-test-adapter-api/-/vscode-test-adapter-api-1.3.0.tgz", - "integrity": "sha512-gMuei0+AmW0cQZi9chdOX3xa6P0EfQ8oIl4pG9M0z0Mq74KHgtbu/RHnAj6i1i+c/6iQEL1AypbobfqAHqlcQg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vscode-test-adapter-api/-/vscode-test-adapter-api-1.4.0.tgz", + "integrity": "sha512-euQzxKMkBQ4RHk9GaMqZUPaTeK8Ud7YeJ9hzjqDrsXjbO6rSauKTkRIBadT775A0e0RFiLVnicyxAWJQZMr9nA==" }, "vscode-test-adapter-util": { "version": "0.6.3", diff --git a/package.json b/package.json index de5b9fe0..24d70115 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "dependencies": { "entities": "^1.1.2", "tslib": "^1.9.3", - "vscode-test-adapter-api": "^1.3.0", + "vscode-test-adapter-api": "^1.4.0", "vscode-test-adapter-util": "^0.6.3", "xml2js": "^0.4.19" }, @@ -58,12 +58,12 @@ "@types/entities": "^1.1.1", "@types/fs-extra": "^5.0.5", "@types/mocha": "^5.2.6", - "@types/node": "^10.12.26", + "@types/node": "^10.12.27", "@types/request-promise": "4.1.42", "@types/sinon": "^5.0.7", "@types/xml2js": "^0.4.3", - "@typescript-eslint/eslint-plugin": "^1.4.0", - "@typescript-eslint/parser": "^1.4.0", + "@typescript-eslint/eslint-plugin": "^1.4.2", + "@typescript-eslint/parser": "^1.4.2", "deep-equal": "^1.0.1", "eslint": "^5.14.1", "eslint-config-prettier": "^4.0.0", diff --git a/src/AbstractTestInfo.ts b/src/AbstractTestInfo.ts index 0a366f0b..0d0aa192 100644 --- a/src/AbstractTestInfo.ts +++ b/src/AbstractTestInfo.ts @@ -12,6 +12,7 @@ export abstract class AbstractTestInfo implements TestInfo { public readonly type: 'test' = 'test'; public readonly id: string; public readonly origLabel: string; + public readonly tooltip: string; protected constructor( protected readonly _shared: SharedVariables, @@ -26,6 +27,7 @@ export abstract class AbstractTestInfo implements TestInfo { ) { this.id = id ? id : generateUniqueId(); this.origLabel = label; + this.tooltip = testNameFull; if (line && line < 0) throw Error('line smaller than zero'); } diff --git a/src/AbstractTestSuiteInfo.ts b/src/AbstractTestSuiteInfo.ts index b2ef1dc5..d3220c7e 100644 --- a/src/AbstractTestSuiteInfo.ts +++ b/src/AbstractTestSuiteInfo.ts @@ -22,7 +22,7 @@ export abstract class AbstractTestSuiteInfo extends AbstractTestSuiteInfoBase { public readonly execPath: string, public readonly execOptions: c2fs.SpawnOptions, ) { - super(shared, origLabel); + super(shared, origLabel, undefined, execPath); } abstract reloadChildren(): Promise; @@ -93,11 +93,14 @@ export abstract class AbstractTestSuiteInfo extends AbstractTestSuiteInfoBase { this.sendSkippedChildrenEvents(); } - const runInfo = new RunningTestExecutableInfo(cp.spawn(this.execPath, execParams, this.execOptions), childrenToRun); + const execOptions = Object.assign({}, this.execOptions); + execOptions.env = Object.assign({}, Object.assign(process.env, execOptions.env)); + + const runInfo = new RunningTestExecutableInfo(cp.spawn(this.execPath, execParams, execOptions), childrenToRun); this._runInfo = runInfo; - this._shared.log.info('proc started:', this.origLabel, this.execPath, execParams, this.execOptions.cwd); + this._shared.log.info('proc started:', this.origLabel, this.execPath, execParams, this.execOptions); runInfo.process.on('error', (err: Error) => { this._shared.log.error('process error event:', err, this); diff --git a/src/AbstractTestSuiteInfoBase.ts b/src/AbstractTestSuiteInfoBase.ts index 3a3cf753..9e83798d 100644 --- a/src/AbstractTestSuiteInfoBase.ts +++ b/src/AbstractTestSuiteInfoBase.ts @@ -17,10 +17,17 @@ export abstract class AbstractTestSuiteInfoBase implements TestSuiteInfo { public children: (AbstractTestSuiteInfoBase | AbstractTestInfo)[] = []; public file?: string; public line?: number; - - public constructor(protected readonly _shared: SharedVariables, public readonly origLabel: string, id?: string) { + public tooltip?: string; + + public constructor( + protected readonly _shared: SharedVariables, + public readonly origLabel: string, + id: string | undefined, + tooltip?: string, + ) { this.label = origLabel; this.id = id ? id : generateUniqueId(); + this.tooltip = tooltip; } public sendSkippedChildrenEvents(): void { @@ -55,13 +62,7 @@ export abstract class AbstractTestSuiteInfoBase implements TestSuiteInfo { this.line = undefined; } - let i = this.children.findIndex((v: AbstractTestSuiteInfoBase | AbstractTestInfo) => { - return child.origLabel.localeCompare(v.origLabel) < 0; - }); - - if (i == -1) i = this.children.length; - - this.children.splice(i, 0, child); + this.children.push(child); } public findRouteToTestById(id: string): (AbstractTestSuiteInfoBase | AbstractTestInfo)[] | undefined { diff --git a/src/Catch2TestSuiteInfo.ts b/src/Catch2TestSuiteInfo.ts index 7d2b5023..0f68a4a1 100644 --- a/src/Catch2TestSuiteInfo.ts +++ b/src/Catch2TestSuiteInfo.ts @@ -76,12 +76,33 @@ export class Catch2TestSuiteInfo extends AbstractTestSuiteInfo { while (lines.length > 0 && lines[lines.length - 1].trim() === '') lines.pop(); - if (lines.length == 0) throw Error('Wrong test list.'); - - // first line: 'Matching test cases:' - for (let i = 1; i < lines.length - 1; ) { - if (lines[i][0] != ' ') this._shared.log.error('Wrong test list output format: ' + lines.toString()); - + lines.shift(); // first line: 'Matching test cases:' + lines.pop(); // last line: '[0-9]+ matching test cases' + + for (let i = 0; i < lines.length; ) { + if (!lines[i].startsWith(' ')) this._shared.log.error('Wrong test list output format: ' + lines.toString()); + + if (lines[i].startsWith(' ')) { + this._shared.log.warn('Probably too long test name: ' + lines); + this.children = []; + const test = this._createCatch2TestInfo( + undefined, + '⚠️ Check the test output message for details ⚠️', + '', + [], + '', + 0, + ); + this._shared.sendTestEventEmitter.fire([ + { + type: 'test', + test: test, + state: 'errored', + message: '⚠️ Probably too long test name!\n🛠 Try to define: #define CATCH_CONFIG_CONSOLE_WIDTH 300)', + }, + ]); + return; + } const testNameFull = lines[i++].substr(2); let filePath = ''; @@ -101,7 +122,7 @@ export class Catch2TestSuiteInfo extends AbstractTestSuiteInfo { if (description.startsWith('(NO DESCRIPTION)')) description = ''; let tags: string[] = []; - if (lines[i].length > 6 && lines[i][6] === '[') { + if (i < lines.length && lines[i].length > 6 && lines[i][6] === '[') { tags = lines[i].trim().split(']'); tags.pop(); for (let j = 0; j < tags.length; ++j) tags[j] += ']'; diff --git a/src/RootTestSuiteInfo.ts b/src/RootTestSuiteInfo.ts index 3cf59fb6..7c195688 100644 --- a/src/RootTestSuiteInfo.ts +++ b/src/RootTestSuiteInfo.ts @@ -17,7 +17,7 @@ export class RootTestSuiteInfo extends AbstractTestSuiteInfoBase implements vsco private readonly _taskPool: TaskPool; public constructor(shared: SharedVariables, workerMaxNumber: number) { - super(shared, 'Catch2 and Google tests'); + super(shared, 'Catch2 and Google tests', undefined); this._taskPool = new TaskPool(workerMaxNumber); } diff --git a/src/TaskPool.ts b/src/TaskPool.ts index ca9acad0..c1f3e386 100644 --- a/src/TaskPool.ts +++ b/src/TaskPool.ts @@ -24,13 +24,7 @@ export class TaskPool { else this._waitingTasks.push(resolve); }).then(task); - const release = (): void => { - this._release(); - }; - - p.then(release, release); - - return p; + return p.finally(() => this._release()); } private _runningTaskCount: number = 0; diff --git a/src/TaskQueue.ts b/src/TaskQueue.ts index ea5f32ed..8a18e5a2 100644 --- a/src/TaskQueue.ts +++ b/src/TaskQueue.ts @@ -25,22 +25,18 @@ export class TaskQueue { public then(task: () => TResult1 | PromiseLike): Promise { this._count++; - const depends: Promise[] = []; + const depends: Promise[] = []; //eslint-disable-line depends[this._depends.length] = this._queue; for (let i = 0; i < this._depends.length; ++i) { depends[i] = this._depends[i]._queue; } - const current = Promise.all(depends).then(task); + this._queue = Promise.all(depends) + .then(task) + .finally(() => this._count--); - const decr = (): void => { - this._count--; - }; - - this._queue = current.then(decr, decr); - - return current; + return this._queue; } public dependsOn(depends: Iterable): void { @@ -53,7 +49,7 @@ export class TaskQueue { } private _count: number = 0; - private _queue: Promise = Promise.resolve(); + private _queue: Promise = Promise.resolve(); //eslint-disable-line private readonly _depends: TaskQueue[] = []; private _checkCircle(tq: TaskQueue): void { diff --git a/src/TestExecutableInfo.ts b/src/TestExecutableInfo.ts index a7720d09..d24684bd 100644 --- a/src/TestExecutableInfo.ts +++ b/src/TestExecutableInfo.ts @@ -187,7 +187,6 @@ export class TestExecutableInfo implements vscode.Disposable { let resolvedEnv: { [prop: string]: string } = {}; try { - Object.assign(resolvedEnv, process.env); Object.assign(resolvedEnv, this._defaultEnv); if (this._env) Object.assign(resolvedEnv, this._env); diff --git a/src/test/TestCatch2FrameworkLoad.test.ts b/src/test/TestCatch2FrameworkLoad.test.ts index e84e812f..99150259 100644 --- a/src/test/TestCatch2FrameworkLoad.test.ts +++ b/src/test/TestCatch2FrameworkLoad.test.ts @@ -9,7 +9,6 @@ import * as vscode from 'vscode'; import * as sinon from 'sinon'; import { TestEvent, - TestLoadFinishedEvent, TestRunFinishedEvent, TestRunStartedEvent, TestSuiteEvent, @@ -977,9 +976,9 @@ describe(path.basename(__filename), function() { await adapter.load(); assert.equal(adapter.testLoadsEvents.length, 2); - root = (adapter.testLoadsEvents[adapter.testLoadsEvents.length - 1] as TestLoadFinishedEvent).suite!; + root = adapter.root; assert.equal(root.children.length, 2); - suite1 = root.children[0] as TestSuiteInfo; + suite1 = adapter.suite1; assert.strictEqual(suite1.children.length, 0); @@ -1358,6 +1357,7 @@ describe(path.basename(__filename), function() { }); it('run suite3 one-by-one', async function() { + this.timeout(5000); await loadAdapter(); assert.equal(root.children.length, 3); assert.equal(root.children[0].type, 'suite'); diff --git a/src/test/TestGoogleFramework.test.ts b/src/test/TestGoogleFramework.test.ts index c60c959a..6e48c3f1 100644 --- a/src/test/TestGoogleFramework.test.ts +++ b/src/test/TestGoogleFramework.test.ts @@ -106,20 +106,20 @@ describe(path.basename(__filename), function() { const expected = [ { type: 'started', tests: [adapter.root.id] }, { type: 'suite', state: 'running', suite: adapter.get(0) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 3) }, - { type: 'test', state: 'running', test: adapter.get(0, 3, 0) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 0) }, + { type: 'test', state: 'running', test: adapter.get(0, 0, 0) }, { type: 'test', state: 'passed', - test: adapter.get(0, 3, 0), + test: adapter.get(0, 0, 0), decorations: [], message: ['[ RUN ] TestCas1.test1', '[ OK ] TestCas1.test1 (0 ms)'].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 3, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 0, 1) }, { type: 'test', state: 'failed', - test: adapter.get(0, 3, 1), + test: adapter.get(0, 0, 1), decorations: [{ line: 18, message: '⬅️ Actual: false; Expected: true;' }], message: [ '[ RUN ] TestCas1.test2', @@ -130,13 +130,13 @@ describe(path.basename(__filename), function() { '[ FAILED ] TestCas1.test2 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 3) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 4) }, - { type: 'test', state: 'running', test: adapter.get(0, 4, 0) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 0) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 1, 0) }, { type: 'test', state: 'failed', - test: adapter.get(0, 4, 0), + test: adapter.get(0, 1, 0), decorations: [ { line: 23, message: '⬅️ Actual: false; Expected: true;' }, { line: 24, message: '⬅️ Actual: true; Expected: false;' }, @@ -168,11 +168,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] TestCas2.test1 (1 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 4, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 1, 1) }, { type: 'test', state: 'failed', - test: adapter.get(0, 4, 1), + test: adapter.get(0, 1, 1), decorations: [ { line: 31, message: '⬅️ Actual: false; Expected: true;' }, { @@ -193,13 +193,13 @@ describe(path.basename(__filename), function() { '[ FAILED ] TestCas2.test2 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 4) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 0) }, - { type: 'test', state: 'running', test: adapter.get(0, 0, 0) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 1) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 2) }, + { type: 'test', state: 'running', test: adapter.get(0, 2, 0) }, { type: 'test', state: 'failed', - test: adapter.get(0, 0, 0), + test: adapter.get(0, 2, 0), decorations: [{ line: 69, message: '⬅️ failure' }], message: [ '[ RUN ] MockTestCase.expect1', @@ -210,11 +210,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] MockTestCase.expect1 (0 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 0, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 2, 1) }, { type: 'test', state: 'failed', - test: adapter.get(0, 0, 1), + test: adapter.get(0, 2, 1), decorations: [{ line: 77, message: '⬅️ failure' }], message: [ '[ RUN ] MockTestCase.expect2', @@ -236,13 +236,13 @@ describe(path.basename(__filename), function() { '[ FAILED ] MockTestCase.expect2 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 0) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 1) }, - { type: 'test', state: 'running', test: adapter.get(0, 1, 0) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 2) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 3) }, + { type: 'test', state: 'running', test: adapter.get(0, 3, 0) }, { type: 'test', state: 'failed', - test: adapter.get(0, 1, 0), + test: adapter.get(0, 3, 0), decorations: [{ line: 40, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams1/FailingParamTest.Fails1/0', @@ -254,11 +254,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams1/FailingParamTest.Fails1/0, where GetParam() = 2 (0 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 1, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 3, 1) }, { type: 'test', state: 'failed', - test: adapter.get(0, 1, 1), + test: adapter.get(0, 3, 1), decorations: [{ line: 40, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams1/FailingParamTest.Fails1/1', @@ -270,11 +270,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams1/FailingParamTest.Fails1/1, where GetParam() = 3 (0 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 1, 2) }, + { type: 'test', state: 'running', test: adapter.get(0, 3, 2) }, { type: 'test', state: 'failed', - test: adapter.get(0, 1, 2), + test: adapter.get(0, 3, 2), decorations: [{ line: 41, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams1/FailingParamTest.Fails2/0', @@ -286,11 +286,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams1/FailingParamTest.Fails2/0, where GetParam() = 2 (1 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 1, 3) }, + { type: 'test', state: 'running', test: adapter.get(0, 3, 3) }, { type: 'test', state: 'failed', - test: adapter.get(0, 1, 3), + test: adapter.get(0, 3, 3), decorations: [{ line: 41, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams1/FailingParamTest.Fails2/1', @@ -302,13 +302,13 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams1/FailingParamTest.Fails2/1, where GetParam() = 3 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 1) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 2) }, - { type: 'test', state: 'running', test: adapter.get(0, 2, 0) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 3) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 4) }, + { type: 'test', state: 'running', test: adapter.get(0, 4, 0) }, { type: 'test', state: 'failed', - test: adapter.get(0, 2, 0), + test: adapter.get(0, 4, 0), decorations: [{ line: 40, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams2/FailingParamTest.Fails1/0', @@ -320,11 +320,11 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams2/FailingParamTest.Fails1/0, where GetParam() = 3 (0 ms)', ].join(EOL), }, - { type: 'test', state: 'running', test: adapter.get(0, 2, 1) }, + { type: 'test', state: 'running', test: adapter.get(0, 4, 1) }, { type: 'test', state: 'failed', - test: adapter.get(0, 2, 1), + test: adapter.get(0, 4, 1), decorations: [{ line: 41, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams2/FailingParamTest.Fails2/0', @@ -336,7 +336,7 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams2/FailingParamTest.Fails2/0, where GetParam() = 3 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 2) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 4) }, { type: 'suite', state: 'completed', suite: adapter.get(0) }, { type: 'finished' }, ]; @@ -350,23 +350,23 @@ describe(path.basename(__filename), function() { this.slow(500); const expected = [ - { type: 'started', tests: [adapter.get(0, 3, 0).id] }, + { type: 'started', tests: [adapter.get(0, 0, 0).id] }, { type: 'suite', state: 'running', suite: adapter.get(0) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 3) }, - { type: 'test', state: 'running', test: adapter.get(0, 3, 0) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 0) }, + { type: 'test', state: 'running', test: adapter.get(0, 0, 0) }, { type: 'test', state: 'passed', - test: adapter.get(0, 3, 0), + test: adapter.get(0, 0, 0), decorations: [], message: ['[ RUN ] TestCas1.test1', '[ OK ] TestCas1.test1 (0 ms)'].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 3) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 0) }, { type: 'suite', state: 'completed', suite: adapter.get(0) }, { type: 'finished' }, ]; - await adapter.run([adapter.get(0, 3, 0).id]); + await adapter.run([adapter.get(0, 0, 0).id]); assert.deepStrictEqual(adapter.testStatesEvents, expected); }); @@ -375,14 +375,14 @@ describe(path.basename(__filename), function() { this.slow(500); const expected = [ - { type: 'started', tests: [adapter.get(0, 1, 0).id] }, + { type: 'started', tests: [adapter.get(0, 3, 0).id] }, { type: 'suite', state: 'running', suite: adapter.get(0) }, - { type: 'suite', state: 'running', suite: adapter.get(0, 1) }, - { type: 'test', state: 'running', test: adapter.get(0, 1, 0) }, + { type: 'suite', state: 'running', suite: adapter.get(0, 3) }, + { type: 'test', state: 'running', test: adapter.get(0, 3, 0) }, { type: 'test', state: 'failed', - test: adapter.get(0, 1, 0), + test: adapter.get(0, 3, 0), decorations: [{ line: 40, message: '⬅️ failure' }], message: [ '[ RUN ] PrintingFailingParams1/FailingParamTest.Fails1/0', @@ -394,12 +394,12 @@ describe(path.basename(__filename), function() { '[ FAILED ] PrintingFailingParams1/FailingParamTest.Fails1/0, where GetParam() = 2 (0 ms)', ].join(EOL), }, - { type: 'suite', state: 'completed', suite: adapter.get(0, 1) }, + { type: 'suite', state: 'completed', suite: adapter.get(0, 3) }, { type: 'suite', state: 'completed', suite: adapter.get(0) }, { type: 'finished' }, ]; - await adapter.run([adapter.get(0, 1, 0).id]); + await adapter.run([adapter.get(0, 3, 0).id]); assert.deepStrictEqual(adapter.testStatesEvents, expected); });