mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
Update unit test NPM dependencies
Updates Karma, Mocha and Sinon. R=jacktfranklin@chromium.org Bug: none Change-Id: Ia93cdafc646e4d3277e7ce869a7a8b5e66a13f0d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372928 Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
0e801b6732
commit
d3425b95d0
+1
-1
@@ -17,7 +17,7 @@ function CaptureTimeoutLauncher (timer, captureTimeout) {
|
||||
return
|
||||
}
|
||||
|
||||
log.warn(`${this.name} have not captured in ${captureTimeout} ms, killing.`)
|
||||
log.warn(`${this.name} has not captured in ${captureTimeout} ms, killing.`)
|
||||
this.error = 'timeout'
|
||||
this.kill()
|
||||
}, captureTimeout)
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ function getQuery (urlStr) {
|
||||
function getXUACompatibleMetaElement (url) {
|
||||
const query = getQuery(url)
|
||||
if (query['x-ua-compatible']) {
|
||||
return `\n<meta http-equiv="X-UA-Compatible" content="${query['x-ua-compatible']}"/>`
|
||||
return `<meta http-equiv="X-UA-Compatible" content="${query['x-ua-compatible']}"/>`
|
||||
}
|
||||
return ''
|
||||
}
|
||||
@@ -107,7 +107,7 @@ function createKarmaMiddleware (
|
||||
} else { // serve client.html
|
||||
return serveStaticFile('/client.html', requestedRangeHeader, response, (data) =>
|
||||
data
|
||||
.replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
|
||||
.replace('%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
|
||||
.replace('%X_UA_COMPATIBLE_URL%', getXUACompatibleUrl(request.url)))
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ function createKarmaMiddleware (
|
||||
.replace('%CLIENT_CONFIG%', 'window.__karma__.config = ' + JSON.stringify(client) + ';\n')
|
||||
.replace('%SCRIPT_URL_ARRAY%', () => 'window.__karma__.scriptUrls = ' + JSON.stringify(scriptUrls) + ';\n')
|
||||
.replace('%MAPPINGS%', () => 'window.__karma__.files = {\n' + mappings.join(',\n') + '\n};\n')
|
||||
.replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
|
||||
.replace('%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
|
||||
})
|
||||
})
|
||||
} else if (requestUrl === '/context.json') {
|
||||
|
||||
+11
-2
@@ -48,7 +48,7 @@ function createErrorFormatter (config, emitter, SourceMapConsumer) {
|
||||
input = JSON.stringify(input, null, indentation)
|
||||
}
|
||||
|
||||
let msg = input.replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) {
|
||||
let msg = input.replace(URL_REGEXP, function (stackTracePath, prefix, path, __, ___, line, ____, column) {
|
||||
const normalizedPath = prefix === 'base/' ? `${basePath}/${path}` : path
|
||||
const file = lastServedFiles.find((file) => file.path === normalizedPath)
|
||||
|
||||
@@ -64,12 +64,21 @@ function createErrorFormatter (config, emitter, SourceMapConsumer) {
|
||||
const zeroBasedColumn = Math.max(0, (column || 1) - 1)
|
||||
const original = getSourceMapConsumer(file.sourceMap).originalPositionFor({ line, column: zeroBasedColumn, bias })
|
||||
|
||||
// If there is no original position/source for the current stack trace path, then
|
||||
// we return early with the formatted generated position. This handles the case of
|
||||
// generated code which does not map to anything, see Case 1 of the source-map spec.
|
||||
// https://sourcemaps.info/spec.html.
|
||||
if (original.source === null) {
|
||||
return PathUtils.formatPathMapping(path, line, column)
|
||||
}
|
||||
|
||||
// Source maps often only have a local file name, resolve to turn into a full path if
|
||||
// the path is not absolute yet.
|
||||
const oneBasedOriginalColumn = original.column == null ? original.column : original.column + 1
|
||||
return `${PathUtils.formatPathMapping(resolve(path, original.source), original.line, oneBasedOriginalColumn)} <- ${PathUtils.formatPathMapping(path, line, column)}`
|
||||
} catch (e) {
|
||||
log.warn(`SourceMap position not found for trace: ${input}`)
|
||||
log.warn(`An unexpected error occurred while resolving the original position for: ${stackTracePath}`)
|
||||
log.warn(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user