@web/test-runner-core
Advanced tools
Comparing version 0.7.5 to 0.7.6
# @web/test-runner-core | ||
## 0.7.6 | ||
### Patch Changes | ||
- ee8c8d1: improved handling of timeouts starting or stopping a page | ||
- e3e6b22: removed usage of deepmerge | ||
## 0.7.5 | ||
@@ -4,0 +11,0 @@ |
@@ -48,3 +48,3 @@ import { CoverageMapData } from 'istanbul-lib-coverage'; | ||
*/ | ||
stopSession(sessionId: string): SessionResult | Promise<SessionResult>; | ||
stopSession(sessionId: string): Promise<SessionResult>; | ||
/** | ||
@@ -51,0 +51,0 @@ * Starts a debug session. This should start a session like startSession, but |
@@ -6,2 +6,3 @@ "use strict"; | ||
const TestSessionStatus_1 = require("../test-session/TestSessionStatus"); | ||
const async_1 = require("../utils/async"); | ||
class TestScheduler { | ||
@@ -73,3 +74,3 @@ constructor(config, sessions) { | ||
try { | ||
await updatedSession.browser.startSession(updatedSession.id, createSessionUrl_1.createSessionUrl(this.config, updatedSession)); | ||
await async_1.withTimeout(updatedSession.browser.startSession(updatedSession.id, createSessionUrl_1.createSessionUrl(this.config, updatedSession)), 'Timeout starting the browser page.', this.config.testsStartTimeout); | ||
// when the browser started, wait for session to ping back on time | ||
@@ -104,3 +105,3 @@ this.waitForTestsStarted(updatedSession.testRun, updatedSession.id); | ||
if (session.browser.isActive(session.id)) { | ||
const { testCoverage, browserLogs } = await session.browser.stopSession(session.id); | ||
const { testCoverage, browserLogs } = await async_1.withTimeout(session.browser.stopSession(session.id), 'Timed out stopping the browser page', this.config.testsFinishTimeout); | ||
updatedSession.testCoverage = testCoverage; | ||
@@ -107,0 +108,0 @@ updatedSession.logs = browserLogs; |
@@ -47,3 +47,3 @@ "use strict"; | ||
return; | ||
sessions.update(Object.assign(Object.assign({}, session), { status: TestSessionStatus_1.SESSION_STATUS.TEST_STARTED, userAgent: ctx.headers['user-agent'] })); | ||
sessions.updateStatus(Object.assign(Object.assign({}, session), { userAgent: ctx.headers['user-agent'] }), TestSessionStatus_1.SESSION_STATUS.TEST_STARTED); | ||
return; | ||
@@ -50,0 +50,0 @@ } |
@@ -8,3 +8,2 @@ "use strict"; | ||
const dev_server_core_1 = require("@web/dev-server-core"); | ||
const deepmerge_1 = __importDefault(require("deepmerge")); | ||
const chokidar_1 = __importDefault(require("chokidar")); | ||
@@ -29,21 +28,19 @@ const watchFilesMiddleware_1 = require("./middleware/watchFilesMiddleware"); | ||
: {}; | ||
const serverConfig = deepmerge_1.default.all([ | ||
{ | ||
port: config.port, | ||
hostname: config.hostname, | ||
rootDir, | ||
mimeTypes: config.mimeTypes, | ||
middleware: [ | ||
testRunnerApiMiddleware_1.testRunnerApiMiddleware(sessions, rootDir, config, plugins), | ||
watchFilesMiddleware_1.watchFilesMiddleware({ runSessions, sessions, rootDir, fileWatcher: this.fileWatcher }), | ||
cacheMiddleware_1.cacheMiddleware(CACHED_PATTERNS, config.watch), | ||
...(config.middleware || []), | ||
], | ||
plugins: [ | ||
serveTestRunnerHtmlPlugin_1.serveTestRunnerHtmlPlugin(config, testFrameworkImport), | ||
testFrameworkPlugin, | ||
...(config.plugins || []), | ||
].filter(isDefined), | ||
}, | ||
]); | ||
const serverConfig = { | ||
port: config.port, | ||
hostname: config.hostname, | ||
rootDir, | ||
mimeTypes: config.mimeTypes, | ||
middleware: [ | ||
testRunnerApiMiddleware_1.testRunnerApiMiddleware(sessions, rootDir, config, plugins), | ||
watchFilesMiddleware_1.watchFilesMiddleware({ runSessions, sessions, rootDir, fileWatcher: this.fileWatcher }), | ||
cacheMiddleware_1.cacheMiddleware(CACHED_PATTERNS, config.watch), | ||
...(config.middleware || []), | ||
], | ||
plugins: [ | ||
serveTestRunnerHtmlPlugin_1.serveTestRunnerHtmlPlugin(config, testFrameworkImport), | ||
testFrameworkPlugin, | ||
...(config.plugins || []), | ||
].filter(isDefined), | ||
}; | ||
this.devServer = new dev_server_core_1.DevServer(serverConfig, config.logger, this.fileWatcher); | ||
@@ -50,0 +47,0 @@ } |
{ | ||
"name": "@web/test-runner-core", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"publishConfig": { | ||
@@ -45,3 +45,2 @@ "access": "public" | ||
"debounce": "^1.2.0", | ||
"deepmerge": "^4.2.2", | ||
"dependency-graph": "^0.9.0", | ||
@@ -48,0 +47,0 @@ "istanbul-lib-coverage": "^3.0.0", |
@@ -54,3 +54,3 @@ import { CoverageMapData } from 'istanbul-lib-coverage'; | ||
*/ | ||
stopSession(sessionId: string): SessionResult | Promise<SessionResult>; | ||
stopSession(sessionId: string): Promise<SessionResult>; | ||
@@ -57,0 +57,0 @@ /** |
@@ -6,2 +6,3 @@ import { createSessionUrl } from './createSessionUrl'; | ||
import { SESSION_STATUS } from '../test-session/TestSessionStatus'; | ||
import { withTimeout } from '../utils/async'; | ||
@@ -91,5 +92,9 @@ export class TestScheduler { | ||
try { | ||
await updatedSession.browser.startSession( | ||
updatedSession.id, | ||
createSessionUrl(this.config, updatedSession), | ||
await withTimeout( | ||
updatedSession.browser.startSession( | ||
updatedSession.id, | ||
createSessionUrl(this.config, updatedSession), | ||
), | ||
'Timeout starting the browser page.', | ||
this.config.testsStartTimeout!, | ||
); | ||
@@ -125,3 +130,7 @@ | ||
if (session.browser.isActive(session.id)) { | ||
const { testCoverage, browserLogs } = await session.browser.stopSession(session.id); | ||
const { testCoverage, browserLogs } = await withTimeout( | ||
session.browser.stopSession(session.id), | ||
'Timed out stopping the browser page', | ||
this.config.testsFinishTimeout!, | ||
); | ||
updatedSession.testCoverage = testCoverage; | ||
@@ -128,0 +137,0 @@ updatedSession.logs = browserLogs; |
@@ -53,7 +53,9 @@ import { Middleware } from '@web/dev-server-core'; | ||
sessions.update({ | ||
...session, | ||
status: SESSION_STATUS.TEST_STARTED, | ||
userAgent: ctx.headers['user-agent'], | ||
}); | ||
sessions.updateStatus( | ||
{ | ||
...session, | ||
userAgent: ctx.headers['user-agent'], | ||
}, | ||
SESSION_STATUS.TEST_STARTED, | ||
); | ||
return; | ||
@@ -60,0 +62,0 @@ } |
@@ -1,3 +0,2 @@ | ||
import { DevServerCoreConfig, DevServer, Plugin } from '@web/dev-server-core'; | ||
import deepmerge from 'deepmerge'; | ||
import { DevServer, Plugin } from '@web/dev-server-core'; | ||
import chokidar from 'chokidar'; | ||
@@ -34,23 +33,21 @@ | ||
: ({} as { testFrameworkImport?: string; testFrameworkPlugin?: Plugin }); | ||
const serverConfig = deepmerge.all<DevServerCoreConfig>([ | ||
{ | ||
port: config.port, | ||
hostname: config.hostname, | ||
rootDir, | ||
const serverConfig = { | ||
port: config.port, | ||
hostname: config.hostname, | ||
rootDir, | ||
mimeTypes: config.mimeTypes, | ||
middleware: [ | ||
testRunnerApiMiddleware(sessions, rootDir, config, plugins), | ||
watchFilesMiddleware({ runSessions, sessions, rootDir, fileWatcher: this.fileWatcher }), | ||
cacheMiddleware(CACHED_PATTERNS, config.watch), | ||
...(config.middleware || []), | ||
], | ||
mimeTypes: config.mimeTypes, | ||
middleware: [ | ||
testRunnerApiMiddleware(sessions, rootDir, config, plugins), | ||
watchFilesMiddleware({ runSessions, sessions, rootDir, fileWatcher: this.fileWatcher }), | ||
cacheMiddleware(CACHED_PATTERNS, config.watch), | ||
...(config.middleware || []), | ||
], | ||
plugins: [ | ||
serveTestRunnerHtmlPlugin(config, testFrameworkImport), | ||
testFrameworkPlugin, | ||
...(config.plugins || []), | ||
].filter(isDefined) as Plugin[], | ||
}, | ||
]); | ||
plugins: [ | ||
serveTestRunnerHtmlPlugin(config, testFrameworkImport), | ||
testFrameworkPlugin, | ||
...(config.plugins || []), | ||
].filter(isDefined) as Plugin[], | ||
}; | ||
@@ -57,0 +54,0 @@ this.devServer = new DevServer(serverConfig, config.logger, this.fileWatcher); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
185690
8
151
3114
- Removeddeepmerge@^4.2.2
- Removeddeepmerge@4.3.1(transitive)