| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1d9c371 commit 54168b7
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,6 +185,17 @@ class FileTest extends Test { | |||
| 185 | 185 | #rawBufferSize = 0; | |
| 186 | 186 | #reportedChildren = 0; | |
| 187 | 187 | failedSubtests = false; | |
| 188 | + | ||
| 189 | + constructor(options) { | ||
| 190 | + super(options); | ||
| 191 | + this.loc ??= { | ||
| 192 | + __proto__: null, | ||
| 193 | + line: 1, | ||
| 194 | + column: 1, | ||
| 195 | + file: resolve(this.name), | ||
| 196 | + }; | ||
| 197 | + } | ||
| 198 | + | ||
| 188 | 199 | #skipReporting() { | |
| 189 | 200 | return this.#reportedChildren > 0 && (!this.error || this.error.failureType === kSubtestsFailed); | |
| 190 | 201 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const fixtures = require('../common/fixtures'); | ||
| 4 | + const { strictEqual } = require('node:assert'); | ||
| 5 | + const { relative } = require('node:path'); | ||
| 6 | + const { run } = require('node:test'); | ||
| 7 | + const fixture = fixtures.path('test-runner', 'never_ending_sync.js'); | ||
| 8 | + const relativePath = relative(process.cwd(), fixture); | ||
| 9 | + const stream = run({ | ||
| 10 | + files: [relativePath], | ||
| 11 | + timeout: common.platformTimeout(100), | ||
| 12 | + }); | ||
| 13 | + | ||
| 14 | + stream.on('test:fail', common.mustCall((result) => { | ||
| 15 | + strictEqual(result.name, relativePath); | ||
| 16 | + strictEqual(result.details.error.failureType, 'testTimeoutFailure'); | ||
| 17 | + strictEqual(result.line, 1); | ||
| 18 | + strictEqual(result.column, 1); | ||
| 19 | + strictEqual(result.file, fixture); | ||
| 20 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments