reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145)

* reapply "switch from jest to vitest for faster, simpler tests (https://github.com/sourcegraph/sourcegraph/pull/57886)"

This was reverted in https://github.com/sourcegraph/sourcegraph/pull/58116 due to an issue with the browser tests.

* include fetch-mock

* fix flakiness

* rm mock that did not work in experimentalVmThreads

* fix

* timeout

* fixup

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
This commit is contained in:
Quinn Slack 2023-11-07 00:00:18 -10:00 committed by GitHub
parent e0f401aee3
commit 4002774429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
570 changed files with 2025 additions and 3455 deletions

View File

@ -22,7 +22,6 @@ const config = {
'**/*.json',
'**/*.d.ts',
'eslint-relative-formatter.js',
'jest.config.js',
'typedoc.js',
'bundlesize.config.js',
],
@ -135,6 +134,7 @@ See https://handbook.sourcegraph.com/community/faq#is-all-of-sourcegraph-open-so
'!@sourcegraph/*/src/stories',
'!@sourcegraph/build-config/src/esbuild/*',
'!@sourcegraph/build-config/src/*',
'!@sourcegraph/testing/src/jestDomMatchers',
],
message:
'Imports from package internals are banned. Add relevant export to the entry point of the package to import it from the outside world.',

View File

@ -5,7 +5,7 @@ module.exports = {
require: [
...(IS_BAZEL ? [] : ['ts-node/register/transpile-only']),
'abort-controller/polyfill',
rootDir + '/client/shared/dev/fetch',
rootDir + '/client/testing/src/fetch',
rootDir + '/client/shared/dev/suppressPollyErrors',
],
reporter: rootDir + '/client/shared/dev/customMochaSpecReporter.js',

View File

@ -11,7 +11,6 @@
"exiasr.hadolint",
"bierner.markdown-mermaid",
"ecmel.vscode-html-css",
"orta.vscode-jest",
"dbaeumer.vscode-eslint",
"foxundermoon.shell-format",
"timonwong.shellcheck",

22
.vscode/launch.json vendored
View File

@ -74,28 +74,6 @@
"E2E_BROWSER": "chrome"
}
},
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": [
"--color",
"--runInBand"
// "path/to/test/file",
// "-t",
// "test name",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
"**/async_hooks.js",
"**/inspector_async_hook.js"
// "**/node_modules/rxjs",
],
"smartStep": false
},
{
"name": "Webapp Chrome",
"type": "chrome",

View File

@ -37,7 +37,6 @@
"build.allowImplicitNetworkAccess": true,
"local": "github.com/sourcegraph/sourcegraph"
},
"jest.jestCommandLine": "pnpm run test",
"npm.packageManager": "pnpm",
"npm.runSilent": true,
"typescript.preferences.quoteStyle": "single",

View File

@ -83,58 +83,20 @@ copy_to_bin(
)
js_library(
name = "jest_config",
name = "vitest_config",
testonly = True,
srcs = [
"jest.config.base.js",
],
data = [
"jest.snapshot-resolver.js",
"vitest.shared.ts",
],
visibility = ["//visibility:public"],
deps = [
":babel_config_jest",
"//:node_modules/@testing-library/jest-dom",
"//:node_modules/abort-controller",
"//:node_modules/babel-jest",
"//:node_modules/core-js",
"//:node_modules/identity-obj-proxy",
"//:node_modules/message-port-polyfill",
"//:node_modules/regenerator-runtime",
"//client/shared/dev:mock",
],
)
js_library(
name = "babel_config_jest",
testonly = True,
srcs = [
"babel.config.jest.js",
],
visibility = ["//visibility:public"],
deps = [
"//:node_modules/@babel/preset-env",
"//:node_modules/@babel/runtime",
"//:node_modules/signale",
],
)
js_library(
name = "babel_config",
srcs = [
"babel.config.js",
],
data = [
":package_json",
],
visibility = ["//visibility:public"],
deps = [
"//:node_modules/@babel/preset-env",
"//:node_modules/@babel/preset-react",
"//:node_modules/@babel/preset-typescript",
"//:node_modules/@babel/runtime",
"//:node_modules/semver",
"//:node_modules/signale",
"//client/testing:testing_lib",
],
)
@ -146,9 +108,9 @@ js_library(
],
deps = [
"//:node_modules/abort-controller",
"//client/shared/dev:fetch-mock",
"//client/shared/dev:mocha-reporter",
"//client/shared/dev:suppress-polly-errors",
"//client/testing:fetch-mock",
],
)

View File

@ -42,13 +42,6 @@ http_archive(
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.0.0/rules_ts-v2.0.0.tar.gz",
)
http_archive(
name = "aspect_rules_jest",
sha256 = "bf8f4a4d2a833e4f96f866c686c38bcee69d3bdae8a827b1c9d2fdf92212bc0b",
strip_prefix = "rules_jest-95d8f1961a9c6f3aee2929881b1b74461652e775",
url = "https://github.com/aspect-build/rules_jest/archive/95d8f1961a9c6f3aee2929881b1b74461652e775.tar.gz",
)
http_archive(
name = "aspect_rules_swc",
sha256 = "8eb9e42ed166f20cacedfdb22d8d5b31156352eac190fc3347db55603745a2d8",
@ -197,22 +190,6 @@ load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
rules_ts_dependencies(ts_version = "4.9.5")
# rules_jest setup ==============================
load("@aspect_rules_jest//jest:dependencies.bzl", "rules_jest_dependencies")
rules_jest_dependencies()
load("@aspect_rules_jest//jest:repositories.bzl", "jest_repositories")
jest_repositories(
name = "jest",
jest_version = "v28.1.0",
)
load("@jest//:npm_repositories.bzl", jest_npm_repositories = "npm_repositories")
jest_npm_repositories()
# rules_swc setup ==============================
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")

View File

@ -1,30 +0,0 @@
// @ts-check
// A minimal babel config only for jest transformations.
// All typescript and react transformations are done by previous
// bazel build rules, so we only need to do jest transformations here.
// TODO(bazel): drop when non-bazel removed.
if (!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)) {
throw new Error(__filename + ' is only for use with Bazel')
}
/** @type {import('@babel/core').ConfigFunction} */
module.exports = api => {
api.cache.forever()
return {
presets: [
[
'@babel/preset-env',
{
targets: {
// We only run jest tests in node. All the browser related transformations
// are already completed on the previous transpilation step.
node: '16',
},
},
],
],
}
}

View File

@ -1,36 +0,0 @@
// @ts-check
/** @type {import('@babel/core').ConfigFunction} */
module.exports = api => {
const isTest = api.env('test')
api.cache.forever()
/**
* Do no use babel-preset-env for mocha tests transpilation in Bazel.
* This is temporary workaround to allow us to use modern language featurs in `drive.page.evaluate` calls.
*/
const disablePresetEnv = Boolean(process.env.DISABLE_PRESET_ENV && JSON.parse(process.env.DISABLE_PRESET_ENV))
return {
presets: [
...(disablePresetEnv
? []
: [
[
'@babel/preset-env',
{
// Node (used for testing) doesn't support modules, so compile to CommonJS for testing.
modules: process.env.BABEL_MODULE ?? (isTest ? 'commonjs' : false),
},
],
]),
['@babel/preset-typescript', { isTSX: true, allExtensions: true }],
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
],
}
}

View File

@ -5,7 +5,7 @@
# gazelle:js_files globals.d.ts
# Test files, snapshots etc:
# gazelle:js_test_files **/*.{spec,test}.{ts,tsx}
# gazelle:js_test_files **/*.test.{ts,tsx}
# gazelle:js_test_files **/mock*.{ts,tsx}
# gazelle:js_test_files **/*.{mock,mocks}.{ts,tsx}
# gazelle:js_test_files **/mocks/**
@ -16,6 +16,10 @@
# gazelle:js_test_files **/WebStory.{ts,tsx}
# TODO(bazel): sveltekit tests
# gazelle:exclude **/web-sveltekit/**/*.ts
# gazelle:exclude **/vitest.config.ts
# Otherwise it gets tripped up on the `declare module 'vitest'` directives to add custom matchers.
# gazelle:js_resolve vitest //:node_modules/vitest
# TODO(bazel): put fixtures + testutils + ? into own rules
# js_{fixture}_files **/*.{fixture,fixtures}.{ts,tsx}

View File

@ -2,10 +2,6 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "esnext",
"baseUrl": ".",
"paths": {
"*": ["src/types/*", "../shared/src/types/*", "../common/src/types/*", "*"],
},
"jsx": "react-jsx",
"rootDir": "./src",
"outDir": "out",

View File

@ -1,11 +1,10 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "jest_test", "npm_package", "sass", "ts_project")
load("//dev:defs.bzl", "npm_package", "sass", "ts_project", "vitest_test")
load("//client/shared/dev:tools.bzl", "module_style_typings")
load("//dev:eslint.bzl", "eslint_config_and_lint_root", "eslint_test_with_types")
# TODO(bazel): storybook build
# gazelle:exclude **/*.story.{ts,tsx}
# gazelle:exclude **/testGlobals.d.ts
# gazelle:js_resolve **/*.module.scss :module_style_typings
@ -25,7 +24,6 @@ eslint_test_with_types(
]),
config = ":eslint_config",
deps = [
"//:jest_config", # required for import/extensions rule not to fail on the `jest.config.base` import.
"//:node_modules/@types/node",
],
)
@ -36,8 +34,6 @@ ts_config(
visibility = ["//client:__subpackages__"],
deps = [
"//:tsconfig",
"//client/client-api:tsconfig",
"//client/codeintellify:tsconfig",
"//client/common:tsconfig",
"//client/extension-api-types:tsconfig",
"//client/observability-client:tsconfig",
@ -170,7 +166,6 @@ ts_project(
tsconfig = ":tsconfig",
deps = [
":module_style_typings",
":node_modules/@sourcegraph/codeintellify", #keep
":node_modules/@sourcegraph/common",
":node_modules/@sourcegraph/http-client",
":node_modules/@sourcegraph/observability-client",
@ -191,7 +186,6 @@ ts_project(
"//:node_modules/@types/react",
"//:node_modules/@types/react-dom",
"//:node_modules/classnames",
"//:node_modules/comlink", #keep
"//:node_modules/copy-to-clipboard",
"//:node_modules/date-fns",
"//:node_modules/dompurify",
@ -241,7 +235,7 @@ ts_project(
"src/search-ui/results/sidebar/SearchFilterSection.test.tsx",
"src/search-ui/results/sidebar/helpers.test.ts",
"src/search-ui/results/use-items-to-show.test.ts",
"src/testGlobals.d.ts", #keep
"src/testSetup.test.ts",
],
tsconfig = ":tsconfig",
deps = [
@ -251,7 +245,6 @@ ts_project(
":node_modules/@sourcegraph/wildcard",
"//:node_modules/@codemirror/autocomplete",
"//:node_modules/@codemirror/state",
"//:node_modules/@jest/globals",
"//:node_modules/@testing-library/jest-dom", #keep
"//:node_modules/@testing-library/react",
"//:node_modules/@testing-library/user-event",
@ -267,6 +260,7 @@ ts_project(
"//:node_modules/react-dom",
"//:node_modules/rxjs",
"//:node_modules/sinon",
"//:node_modules/vitest",
],
)
@ -279,13 +273,16 @@ npm_package(
],
)
jest_test(
filegroup(
name = "snapshots",
srcs = glob(["src/**/__snapshots__/*"]),
)
vitest_test(
name = "test",
timeout = "long",
data = [
":branded_tests",
":snapshots",
],
patch_node_fs = False,
shard_count = 6,
tags = ["no-sandbox"],
)

View File

@ -1,11 +0,0 @@
// @ts-check
/** @type {import('@jest/types').Config.InitialOptions} */
const config = require('../../jest.config.base')
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
...config,
displayName: 'branded',
rootDir: __dirname,
}

View File

@ -9,15 +9,13 @@
"storybook": "STORIES_GLOB='client/branded/src/**/*.story.tsx' pnpm --filter @sourcegraph/storybook run start",
"lint:js": "eslint --cache '**/*.[jt]s?(x)'",
"lint:css": "stylelint 'src/**/*.scss' --quiet",
"test": "jest"
"test": "vitest"
},
"devDependencies": {
"@sourcegraph/extension-api-types": "workspace:*",
"@sourcegraph/testing": "workspace:*"
},
"dependencies": {
"@sourcegraph/client-api": "workspace:*",
"@sourcegraph/codeintellify": "workspace:*",
"@sourcegraph/common": "workspace:*",
"@sourcegraph/observability-client": "workspace:*",
"@sourcegraph/shared": "workspace:*",

View File

@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals'
import { render } from '@testing-library/react'
import { describe, expect, test } from 'vitest'
import { Timestamp, TimestampFormat } from './Timestamp'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Timestamp absolute time with formatting 1`] = `
exports[`Timestamp > absolute time with formatting 1`] = `
<DocumentFragment>
<span
class="timestamp"
@ -10,42 +10,42 @@ exports[`Timestamp absolute time with formatting 1`] = `
</DocumentFragment>
`;
exports[`Timestamp mocked current time 1`] = `
exports[`Timestamp > mocked current time 1`] = `
<DocumentFragment>
<span
class="timestamp"
>
about 22 hours ago
almost 18 years ago
</span>
</DocumentFragment>
`;
exports[`Timestamp noAbout 1`] = `
exports[`Timestamp > noAbout 1`] = `
<DocumentFragment>
<span
class="timestamp"
>
22 hours ago
almost 18 years ago
</span>
</DocumentFragment>
`;
exports[`Timestamp noAgo 1`] = `
exports[`Timestamp > noAgo 1`] = `
<DocumentFragment>
<span
class="timestamp"
>
about 22 hours
almost 18 years
</span>
</DocumentFragment>
`;
exports[`Timestamp with time time 1`] = `
exports[`Timestamp > with time time 1`] = `
<DocumentFragment>
<span
class="timestamp"
>
about 21 hours ago
almost 18 years ago
</span>
</DocumentFragment>
`;

View File

@ -1,7 +1,7 @@
import { describe, expect, test } from '@jest/globals'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'
import { describe, expect, test } from 'vitest'
import { Toggle } from './Toggle'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Toggle aria 1`] = `
exports[`Toggle > aria 1`] = `
<DocumentFragment>
<button
aria-describedby="test-id-1"
@ -21,7 +21,7 @@ exports[`Toggle aria 1`] = `
</DocumentFragment>
`;
exports[`Toggle className 1`] = `
exports[`Toggle > className 1`] = `
<DocumentFragment>
<button
class="toggle c inlineCenter"
@ -39,7 +39,7 @@ exports[`Toggle className 1`] = `
</DocumentFragment>
`;
exports[`Toggle disabled 1`] = `
exports[`Toggle > disabled 1`] = `
<DocumentFragment>
<button
class="toggle inlineCenter"
@ -59,7 +59,7 @@ exports[`Toggle disabled 1`] = `
</DocumentFragment>
`;
exports[`Toggle value is false 1`] = `
exports[`Toggle > value is false 1`] = `
<DocumentFragment>
<button
aria-checked="false"
@ -78,7 +78,7 @@ exports[`Toggle value is false 1`] = `
</DocumentFragment>
`;
exports[`Toggle value is true 1`] = `
exports[`Toggle > value is true 1`] = `
<DocumentFragment>
<button
aria-checked="true"

View File

@ -1,7 +1,7 @@
import React from 'react'
import { afterEach, describe, expect, it } from '@jest/globals'
import { cleanup, fireEvent } from '@testing-library/react'
import { afterEach, describe, expect, it } from 'vitest'
import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing'

View File

@ -1,7 +1,7 @@
import { afterAll, describe, expect, it } from '@jest/globals'
import { cleanup, getByText, render } from '@testing-library/react'
import { of } from 'rxjs'
import { map } from 'rxjs/operators'
import { afterAll, describe, expect, it } from 'vitest'
import {
HIGHLIGHTED_FILE_LINES,

View File

@ -1,8 +1,8 @@
import { afterAll, describe, expect, it } from '@jest/globals'
import { cleanup, getAllByTestId, getByTestId } from '@testing-library/react'
import { createBrowserHistory } from 'history'
import FileIcon from 'mdi-react/FileIcon'
import sinon from 'sinon'
import { afterAll, describe, expect, it } from 'vitest'
import type { ContentMatch } from '@sourcegraph/shared/src/search/stream'
import type { SettingsCascade } from '@sourcegraph/shared/src/settings/settings'

View File

@ -1,8 +1,8 @@
import { afterAll, describe, it } from '@jest/globals'
import { cleanup } from '@testing-library/react'
import * as H from 'history'
import { of } from 'rxjs'
import sinon from 'sinon'
import { afterAll, describe, it } from 'vitest'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import {

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing'

View File

@ -1,5 +1,5 @@
import { describe, expect, it } from '@jest/globals'
import { render } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { SyntaxHighlightedSearchQuery } from './SyntaxHighlightedSearchQuery'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`RepoFileLink renders 1`] = `
exports[`RepoFileLink > renders 1`] = `
<DocumentFragment>
<span>
<span>

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`SyntaxHighlightedSearchQuery should syntax highlight filter 1`] = `
exports[`SyntaxHighlightedSearchQuery > should syntax highlight filter 1`] = `
<DocumentFragment>
<span
class="text-monospace search-query-link"
@ -44,7 +44,7 @@ exports[`SyntaxHighlightedSearchQuery should syntax highlight filter 1`] = `
</DocumentFragment>
`;
exports[`SyntaxHighlightedSearchQuery should syntax highlight filter and operator 1`] = `
exports[`SyntaxHighlightedSearchQuery > should syntax highlight filter and operator 1`] = `
<DocumentFragment>
<span
class="text-monospace search-query-link"
@ -98,7 +98,7 @@ exports[`SyntaxHighlightedSearchQuery should syntax highlight filter and operato
</DocumentFragment>
`;
exports[`SyntaxHighlightedSearchQuery should syntax highlight negated filter 1`] = `
exports[`SyntaxHighlightedSearchQuery > should syntax highlight negated filter 1`] = `
<DocumentFragment>
<span
class="text-monospace search-query-link"
@ -132,7 +132,7 @@ exports[`SyntaxHighlightedSearchQuery should syntax highlight negated filter 1`]
</DocumentFragment>
`;
exports[`SyntaxHighlightedSearchQuery should syntax highlight operator 1`] = `
exports[`SyntaxHighlightedSearchQuery > should syntax highlight operator 1`] = `
<DocumentFragment>
<span
class="text-monospace search-query-link"

View File

@ -1,6 +1,6 @@
import { describe, expect, test } from '@jest/globals'
import { render } from '@testing-library/react'
import { noop } from 'lodash'
import { describe, expect, test } from 'vitest'
import { PlainQueryInput } from './LazyQueryInput'

View File

@ -1,8 +1,8 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { act } from 'react-dom/test-utils'
import { spy, assert, useFakeTimers } from 'sinon'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'
import { MockIntersectionObserver } from '@sourcegraph/shared/src/testing/MockIntersectionObserver'

View File

@ -1,9 +1,9 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { act } from 'react-dom/test-utils'
import { of } from 'rxjs'
import sinon from 'sinon'
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import type { ListSearchContextsResult, SearchContextMinimalFields } from '@sourcegraph/shared/src/graphql-operations'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`PlainQueryInput empty 1`] = `
exports[`PlainQueryInput > empty 1`] = `
<DocumentFragment>
<div
class="container loader-input loaderInput w-100"
@ -15,7 +15,7 @@ exports[`PlainQueryInput empty 1`] = `
</DocumentFragment>
`;
exports[`PlainQueryInput with query 1`] = `
exports[`PlainQueryInput > with query 1`] = `
<DocumentFragment>
<div
class="container loader-input loaderInput w-100"

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`SearchContextMenu should filter list by spec when searching 1`] = `
exports[`SearchContextMenu > should filter list by spec when searching 1`] = `
Array [
<li
aria-selected="false"

View File

@ -1,5 +1,5 @@
import type { Completion } from '@codemirror/autocomplete'
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import { SymbolKind } from '@sourcegraph/shared/src/graphql-operations'
import { POPULAR_LANGUAGES } from '@sourcegraph/shared/src/search/query/languageFilter'

View File

@ -1,5 +1,5 @@
import { EditorState } from '@codemirror/state'
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'

View File

@ -1,4 +1,4 @@
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import { shortenPath } from './utils'

View File

@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals'
import { screen } from '@testing-library/react'
import { describe, expect, test } from 'vitest'
import { SearchPatternType } from '@sourcegraph/shared/src/graphql-operations'
import { SearchMode } from '@sourcegraph/shared/src/search'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Toggles Query input toggle state case toggle for case subexpressions 1`] = `
exports[`Toggles > Query input toggle state > case toggle for case subexpressions 1`] = `
Array [
<div
aria-checked="false"
@ -27,7 +27,7 @@ Array [
]
`;
exports[`Toggles Query input toggle state case toggle for patterntype subexpressions 1`] = `
exports[`Toggles > Query input toggle state > case toggle for patterntype subexpressions 1`] = `
Array [
<div
aria-checked="false"
@ -54,7 +54,7 @@ Array [
]
`;
exports[`Toggles Query input toggle state regexp toggle for patterntype subexpressions 1`] = `
exports[`Toggles > Query input toggle state > regexp toggle for patterntype subexpressions 1`] = `
Array [
<div
aria-checked="false"

View File

@ -1,5 +1,5 @@
import { describe, expect, it } from '@jest/globals'
import { render } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import type { Progress } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,7 +1,7 @@
import { beforeAll, describe, expect, it } from '@jest/globals'
import { screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'
import { beforeAll, describe, expect, it } from 'vitest'
import type { Progress } from '@sourcegraph/shared/src/search/stream'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -1,7 +1,7 @@
import { describe, expect, it } from '@jest/globals'
import { screen, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'
import { describe, expect, it } from 'vitest'
import type { Progress } from '@sourcegraph/shared/src/search/stream'
import { NOOP_TELEMETRY_SERVICE } from '@sourcegraph/shared/src/telemetry/telemetryService'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`StreamingProgressCount should render correctly for 0 items in progress 1`] = `
exports[`StreamingProgressCount > should render correctly for 0 items in progress 1`] = `
<DocumentFragment>
<span
aria-live="polite"
@ -31,7 +31,7 @@ exports[`StreamingProgressCount should render correctly for 0 items in progress
</DocumentFragment>
`;
exports[`StreamingProgressCount should render correctly for 0 repositories 1`] = `
exports[`StreamingProgressCount > should render correctly for 0 repositories 1`] = `
<DocumentFragment>
<span
aria-live="polite"
@ -76,7 +76,7 @@ exports[`StreamingProgressCount should render correctly for 0 repositories 1`] =
</DocumentFragment>
`;
exports[`StreamingProgressCount should render correctly for 1 item complete 1`] = `
exports[`StreamingProgressCount > should render correctly for 1 item complete 1`] = `
<DocumentFragment>
<small
class="d-flex align-items-center count"
@ -115,7 +115,7 @@ exports[`StreamingProgressCount should render correctly for 1 item complete 1`]
</DocumentFragment>
`;
exports[`StreamingProgressCount should render correctly for 123 items complete 1`] = `
exports[`StreamingProgressCount > should render correctly for 123 items complete 1`] = `
<DocumentFragment>
<small
class="d-flex align-items-center count"
@ -154,7 +154,7 @@ exports[`StreamingProgressCount should render correctly for 123 items complete 1
</DocumentFragment>
`;
exports[`StreamingProgressCount should render correctly for big numbers complete 1`] = `
exports[`StreamingProgressCount > should render correctly for big numbers complete 1`] = `
<DocumentFragment>
<small
class="d-flex align-items-center count"
@ -193,7 +193,7 @@ exports[`StreamingProgressCount should render correctly for big numbers complete
</DocumentFragment>
`;
exports[`StreamingProgressCount should render correctly for limithit 1`] = `
exports[`StreamingProgressCount > should render correctly for limithit 1`] = `
<DocumentFragment>
<small
class="d-flex align-items-center count"

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`StreamingProgressSkippedPopover should render correctly 1`] = `
exports[`StreamingProgressSkippedPopover > should render correctly 1`] = `
<DocumentFragment>
<p
class="mx-3 mt-3"

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import { validateQueryForExhaustiveSearch } from './exhaustive-search-validation'

View File

@ -1,7 +1,7 @@
import { describe, expect, it } from '@jest/globals'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'
import { describe, expect, it } from 'vitest'
import type { SearchScope } from '@sourcegraph/shared/src/schema/settings.schema'
import type { Filter } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,4 +1,4 @@
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import type { QuickLink } from '@sourcegraph/shared/src/schema/settings.schema'
import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing'

View File

@ -1,7 +1,7 @@
import { describe, expect, it } from '@jest/globals'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { stub } from 'sinon'
import { describe, expect, it } from 'vitest'
import type { Filter } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`FilterLink should have correct links for dynamic filters 1`] = `
exports[`FilterLink > should have correct links for dynamic filters 1`] = `
<DocumentFragment>
<button
aria-label="lang:go, At least 500 results match this filter."
@ -128,7 +128,7 @@ exports[`FilterLink should have correct links for dynamic filters 1`] = `
</DocumentFragment>
`;
exports[`FilterLink should have correct links for repos 1`] = `
exports[`FilterLink > should have correct links for repos 1`] = `
<DocumentFragment>
<button
aria-label="Search in repository gitlab.com/sourcegraph/sourcegraph, At least 5 results match this filter."
@ -205,7 +205,7 @@ exports[`FilterLink should have correct links for repos 1`] = `
</DocumentFragment>
`;
exports[`FilterLink should have correct links for scopes 1`] = `
exports[`FilterLink > should have correct links for scopes 1`] = `
<DocumentFragment>
<button
aria-label="Use search snippet: This is a search scope with a very long name lorem ipsum dolor sit amet"
@ -236,7 +236,7 @@ exports[`FilterLink should have correct links for scopes 1`] = `
</DocumentFragment>
`;
exports[`FilterLink should have show icons for repos on cloud 1`] = `
exports[`FilterLink > should have show icons for repos on cloud 1`] = `
<DocumentFragment>
<button
aria-label="Search in repository gitlab.com/sourcegraph/sourcegraph, At least 5 results match this filter."

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`QuickLink should have correct links when quicklinks present 1`] = `
exports[`QuickLink > should have correct links when quicklinks present 1`] = `
<DocumentFragment>
<a
class="anchorLink sidebarSectionListItem"

View File

@ -1,5 +1,5 @@
import { describe, expect, it } from '@jest/globals'
import { renderHook } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { FilterType } from '@sourcegraph/shared/src/search/query/filters'
import type { Filter } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,6 +1,6 @@
import { afterEach, describe, expect, it } from '@jest/globals'
import { act, renderHook } from '@testing-library/react'
import { times } from 'lodash'
import { afterEach, describe, expect, it } from 'vitest'
import { INCREMENTAL_ITEMS_TO_SHOW, DEFAULT_INITIAL_ITEMS_TO_SHOW, useItemsToShow } from './use-items-to-show'

View File

@ -1 +0,0 @@
/// <reference types="@testing-library/jest-dom/types/jest-globals" />

View File

@ -0,0 +1,11 @@
// TODO(sqs): for some reason, `import '@sourcegraph/testing/src/jestDomMatchers'` does not work (it
// does not extend Assertion with the types).
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers'
import * as matchers from '@testing-library/jest-dom/matchers'
import { expect } from 'vitest'
declare module 'vitest' {
interface Assertion<T = any> extends jest.Matchers<void, T>, TestingLibraryMatchers<T, void> {}
}
expect.extend(matchers)

View File

@ -4,21 +4,12 @@
"jsx": "react-jsx",
"module": "commonjs",
"sourceRoot": "src",
"paths": {
"*": ["../observability-client/src/types/*"],
},
"rootDir": ".",
"outDir": "./out",
},
"include": ["src", "./src/**/*.json"],
"exclude": ["../../node_modules", "./node_modules", "./out"],
"references": [
{
"path": "../client-api",
},
{
"path": "../codeintellify",
},
{
"path": "../common",
},

View File

@ -0,0 +1,13 @@
import { defineProjectWithDefaults } from '../../vitest.shared'
export default defineProjectWithDefaults(__dirname, {
test: {
environment: 'jsdom',
setupFiles: [
'src/testSetup.test.ts',
'../testing/src/reactCleanup.ts',
'../testing/src/mockMatchMedia.ts',
'../testing/src/mockUniqueId.ts',
],
},
})

View File

@ -1,7 +1,7 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "jest_test", "sass", "ts_project")
load("//dev:defs.bzl", "sass", "ts_project", "vitest_test")
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//client/shared/dev:generate_graphql_operations.bzl", "generate_graphql_operations")
load("//client/shared/dev:build_code_intel_extensions.bzl", "build_code_intel_extensions")
@ -11,7 +11,6 @@ load("//dev:eslint.bzl", "eslint_config_and_lint_root", "eslint_test_with_types"
# TODO(bazel): storybook build
# gazelle:exclude **/*.story.{ts,tsx}
# gazelle:exclude **/testGlobals.d.ts
# gazelle:js_resolve **/*.module.scss :module_style_typings
@ -40,7 +39,6 @@ eslint_test_with_types(
config = ":eslint_config",
deps = [
":node_modules/@sourcegraph/shared", # required for import/extensions rule not to fail.
"//:jest_config", # required for import/extensions rule not to fail on the `jest.config.base` import.
"//:node_modules/@types/node",
],
)
@ -248,7 +246,6 @@ ts_project(
":node_modules/@sourcegraph/http-client",
":node_modules/@sourcegraph/shared",
":node_modules/@sourcegraph/wildcard",
"//:node_modules/@jest/globals",
"//:node_modules/@mdi/js",
"//:node_modules/@reach/combobox",
"//:node_modules/@sentry/browser",
@ -265,7 +262,6 @@ ts_project(
"//:node_modules/comlink",
"//:node_modules/graphql",
"//:node_modules/history",
"//:node_modules/jest", #keep
"//:node_modules/jsonc-parser",
"//:node_modules/lodash",
"//:node_modules/mdi-react",
@ -276,6 +272,7 @@ ts_project(
"//:node_modules/simmerjs",
"//:node_modules/utility-types",
"//:node_modules/uuid",
"//:node_modules/vitest",
"//:node_modules/webext-domain-permission-toggle",
"//:node_modules/webextension-polyfill", #keep
],
@ -304,7 +301,7 @@ ts_project(
"src/shared/code-hosts/shared/codeViews.test.ts",
"src/shared/code-hosts/shared/views.test.ts",
"src/shared/code-hosts/sourcegraph/inject.test.tsx",
"src/testGlobals.d.ts", #keep
"src/testSetup.test.ts",
],
tsconfig = ":tsconfig",
deps = [
@ -316,7 +313,6 @@ ts_project(
":node_modules/@sourcegraph/testing",
":node_modules/@sourcegraph/wildcard", #keep
":node_modules/sourcegraph",
"//:node_modules/@jest/globals",
"//:node_modules/@testing-library/jest-dom", #keep
"//:node_modules/@testing-library/react",
"//:node_modules/@types/lodash",
@ -324,7 +320,6 @@ ts_project(
"//:node_modules/@types/node",
"//:node_modules/@types/sinon",
"//:node_modules/comlink",
"//:node_modules/jest-fetch-mock",
"//:node_modules/lodash",
"//:node_modules/mz",
"//:node_modules/process",
@ -332,30 +327,23 @@ ts_project(
"//:node_modules/sinon",
"//:node_modules/util",
"//:node_modules/utility-types",
"//:node_modules/vitest",
"//:node_modules/vitest-fetch-mock",
],
)
js_library(
name = "jest_config",
testonly = True,
srcs = [
"jest.config.js",
],
data = [
"src/shared/jestSetupAfterEnv.js",
],
deps = ["//:jest_config"],
filegroup(
name = "snapshots",
srcs = glob(["src/**/__snapshots__/*"]),
)
jest_test(
vitest_test(
name = "test",
timeout = "moderate",
config = ":jest_config",
data = [
":browser_tests",
":snapshots",
],
patch_node_fs = True,
shard_count = 6,
)
filegroup(

View File

@ -20,7 +20,6 @@ ts_project(
tsconfig = "//client/browser:tsconfig",
visibility = ["//client:__subpackages__"],
deps = [
"//:node_modules/@babel/runtime", #keep
"//:node_modules/@types/node",
"//:node_modules/esbuild",
# HACKS: bundle-time css import

View File

@ -1,14 +0,0 @@
// @ts-check
/** @type {import('@jest/types').Config.InitialOptions} */
const config = require('../../jest.config.base')
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
...config,
displayName: 'browser',
rootDir: __dirname,
roots: ['<rootDir>/src'],
modulePathIgnorePatterns: ['<rootDir>/.*runfiles.*', '.*/end-to-end/.*'], // TODO(sqs)
setupFilesAfterEnv: [...(config.setupFilesAfterEnv || []), '<rootDir>/src/shared/jestSetupAfterEnv.js'],
}

View File

@ -23,7 +23,7 @@
"lint:js": "eslint --cache '**/*.[jt]s?(x)'",
"lint:css": "stylelint 'src/**/*.scss'",
"clean": "rm -rf build/ dist/ *.zip *.xpi .checksum",
"test": "jest --testPathIgnorePatterns end-to-end --testPathIgnorePatterns integration",
"test": "vitest",
"test-e2e": "TS_NODE_PROJECT=src/end-to-end/tsconfig.json mocha './src/end-to-end/**/*.test.ts'",
"run-integration": "TS_NODE_PROJECT=src/integration/tsconfig.json SOURCEGRAPH_BASE_URL=https://sourcegraph.com mocha --parallel=${CI:-\"false\"} --retries=2 ./src/integration/**/*.test.ts",
"test-integration": "node scripts/test-integration",

View File

@ -39,11 +39,6 @@ declare var SOURCEGRAPH_PHABRICATOR_EXTENSION: boolean | undefined
/** Set from the Phabricator native integration. **/
declare var SOURCEGRAPH_BUNDLE_URL: string | undefined
/**
* Set by shared/dev/jest-environment.js
*/
declare var jsdom: import('jsdom').JSDOM
declare module '*.scss' {
const cssModule: string
export default cssModule

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import type { LineOrPositionOrRange } from '@sourcegraph/common'

View File

@ -1,111 +1,111 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 54 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 54 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "routes []*Route",
"selector": "DIV.diff-editor.side-by-side-diff-editor-to > DIV.CodeMirror.cm-s-stash-default > DIV.CodeMirror-scroll > DIV.CodeMirror-sizer > DIV > DIV.CodeMirror-lines > DIV > DIV.CodeMirror-code > DIV.context.line:nth-child(54) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 54 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 54 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line.54  routes []*Route",
"selector": "DIV.diff-editor.side-by-side-diff-editor-to > DIV.CodeMirror.cm-s-stash-default > DIV.CodeMirror-scroll > DIV.CodeMirror-sizer > DIV > DIV.CodeMirror-lines > DIV > DIV.CodeMirror-code > DIV.context.line:nth-child(54)",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 60 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 60 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "namedRoutes2 map[string]*Route",
"selector": "DIV.added.modified.line.last-focus:nth-child(60) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 60 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 60 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line.60+ namedRoutes2 map[string]*Route",
"selector": "DIV.added.modified.line.last-focus:nth-child(60)",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 102 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 102 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "c.regexp.path = copyRouteRegexp(r.regexp.path)",
"selector": "DIV.removed.modified.line:nth-child(102) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Split view line number 102 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Split view > line number 102 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line.102- c.regexp.path = copyRouteRegexp(r.regexp.path)",
"selector": "DIV.removed.modified.line:nth-child(102)",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 54 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 54 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "routes []*Route",
"selector": "DIV.context.line:nth-child(6) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 54 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 54 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line.5454  routes []*Route",
"selector": "DIV.context.line:nth-child(6)",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 60 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 60 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "namedRoutes2 map[string]*Route",
"selector": "DIV.added.modified.line:nth-child(12) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 60 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 60 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line. 60+ namedRoutes2 map[string]*Route",
"selector": "DIV.added.modified.line:nth-child(12)",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 102 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 102 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "c.regexp.path = copyRouteRegexp(r.regexp.path)",
"selector": "DIV.removed.modified.line:nth-child(38) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions diffDOMFunctions Unified view line number 102 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > diffDOMFunctions > Unified view > line number 102 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "This line has a comment.Add a comment on this line.102 - c.regexp.path = copyRouteRegexp(r.regexp.path)",
"selector": "DIV.removed.modified.line:nth-child(38)",
}
`;
exports[`Bitbucket DOM functions singleFileDOMFunctions line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > singleFileDOMFunctions > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "DIV.line:nth-child(1) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions singleFileDOMFunctions line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > singleFileDOMFunctions > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "1// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "DIV.line:nth-child(1)",
}
`;
exports[`Bitbucket DOM functions singleFileDOMFunctions line number 18 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Bitbucket DOM functions > singleFileDOMFunctions > line number 18 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "return setVars(r, val)",
"selector": "DIV.line:nth-child(18) > PRE.CodeMirror-line > SPAN",
}
`;
exports[`Bitbucket DOM functions singleFileDOMFunctions line number 18 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Bitbucket DOM functions > singleFileDOMFunctions > line number 18 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "18 return setVars(r, val)",
"selector": "DIV.line:nth-child(18)",

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import type { LineOrPositionOrRange } from '@sourcegraph/common'

View File

@ -1,5 +1,5 @@
import { describe } from '@jest/globals'
import { startCase } from 'lodash'
import { describe } from 'vitest'
import { testDOMFunctions } from '../shared/codeHostTestUtils'

View File

@ -1,5 +1,5 @@
import { afterEach, describe, expect, it } from '@jest/globals'
import { readFile } from 'mz/fs'
import { afterEach, describe, expect, it } from 'vitest'
import { getFixtureBody } from '../shared/codeHostTestUtils'

View File

@ -1,783 +1,783 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 80 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 80 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 80 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 80 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 82 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 82 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 82 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 82 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 82 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 82 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Split view line number 82 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Split view > line number 82 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 80 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 80 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 80 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 80 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 82 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 82 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.blob-code.blob-code-deletion > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 82 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 82 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 82 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 82 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Refined Github Unified view line number 82 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Refined Github > Unified view > line number 82 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 80 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 80 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 80 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 80 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 82 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 82 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 82 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 82 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 82 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 82 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Split view line number 82 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Split view > line number 82 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 80 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 80 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 80 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 80 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// field of the match argument.",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 82 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 82 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.blob-code.blob-code-deletion > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 82 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 82 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- fmt.Println(\\"hello world!\\")",
"selector": "TD.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 82 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 82 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Commit page Vanilla Unified view line number 82 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Commit page > Vanilla > Unified view > line number 82 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ fmt.Println(\\"hello world!!\\")",
"selector": "TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request Discussion page Refined Github line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request Discussion page > Refined Github > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request Discussion page Refined Github line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request Discussion page > Refined Github > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request Discussion page Vanilla line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request Discussion page > Vanilla > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request Discussion page Vanilla line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request Discussion page > Vanilla > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Split view line number 63 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Split view > line number 63 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Split view line number 63 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Split view > line number 63 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Split view line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Split view > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Split view line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Split view > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Unified view line number 63 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Unified view > line number 63 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Unified view line number 63 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Unified view > line number 63 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Unified view line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Unified view > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Refined Github Unified view line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Refined Github > Unified view > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Split view line number 63 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Split view > line number 63 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Split view line number 63 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Split view > line number 63 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Split view line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Split view > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Split view line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Split view > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Unified view line number 63 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Unified view > line number 63 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Unified view line number 63 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Unified view > line number 63 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "KeepContext bool",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Unified view line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Unified view > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.blob-code.blob-code-addition > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions ghe-2.14.11 Pull Request page Vanilla Unified view line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > ghe-2.14.11 > Pull Request page > Vanilla > Unified view > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ // Another field",
"selector": "TR:nth-child(5) > TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 41 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 41 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 41 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 41 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 42 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 42 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 42 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 42 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 42 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 42 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Split view line number 42 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Split view > line number 42 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 41 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 41 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 41 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 41 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 42 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 42 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 42 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 42 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 42 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 42 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.blob-code.blob-code-addition:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Refined Github Unified view line number 42 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Refined Github > Unified view > line number 42 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.blob-code.blob-code-addition:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 41 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 41 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 41 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 41 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 42 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 42 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 42 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 42 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 42 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 42 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Split view line number 42 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Split view > line number 42 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 41 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 41 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 41 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 41 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- You can find out who is on-call by typing \`/genie whoisoncall\` in Slack.",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 42 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 42 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 42 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 42 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie <description of incident and link to Slack thread> with ops_team\`.",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 42 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 42 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.blob-code.blob-code-addition:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Commit page Vanilla Unified view line number 42 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Commit page > Vanilla > Unified view > line number 42 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- If you are not able to immediately get in contact with the on-call engineer, then manually create a new OpsGenie alert by typing \`/genie alert \\"description of incident and link to Slack thread\\" for ops_team\`.",
"selector": "TD.blob-code.blob-code-addition:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request Discussion page Refined Github line number 13 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request Discussion page > Refined Github > line number 13 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export class TestResourceManager {",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request Discussion page Refined Github line number 13 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request Discussion page > Refined Github > line number 13 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export class TestResourceManager {",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request Discussion page Vanilla line number 13 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request Discussion page > Vanilla > line number 13 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export class TestResourceManager {",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker-addition.annotated",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request Discussion page Vanilla line number 13 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request Discussion page > Vanilla > line number 13 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export class TestResourceManager {",
"selector": "TR:nth-child(4) > TD.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 570 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 570 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 570 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 570 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 572 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 572 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 572 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 572 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 572 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 572 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Split view line number 572 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Split view > line number 572 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 570 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 570 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 570 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 570 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 572 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 572 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 572 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 572 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 572 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 572 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-addition:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Refined Github Unified view line number 572 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Refined Github > Unified view > line number 572 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-addition:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 570 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 570 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 570 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 570 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.code-review.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 572 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 572 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-deletion > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 572 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 572 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-deletion",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 572 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 572 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-addition > SPAN.blob-code-inner.blob-code-marker",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Split view line number 572 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Split view > line number 572 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.code-review.blob-code.blob-code-addition",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 570 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 570 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 570 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 570 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export interface CodeEditor {",
"selector": "TR:nth-child(3) > TD.blob-code.blob-code-context:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 572 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 572 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 572 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 572 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-deletion:nth-child(4)",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 572 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 572 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-addition:nth-child(4) > SPAN.blob-code-inner",
}
`;
exports[`GitHub DOM functions diffDomFunctions github.com Pull Request page Vanilla Unified view line number 572 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > diffDomFunctions > github.com > Pull Request page > Vanilla > Unified view > line number 572 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "readonly type: 'CodeEditor'",
"selector": "TD.blob-code.blob-code-addition:nth-child(4)",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Refined Github line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Refined Github > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Refined Github line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Refined Github > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Refined Github line number 2 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Refined Github > line number 2 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// Use of this source code is governed by a BSD-style",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Refined Github line number 2 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Refined Github > line number 2 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// Use of this source code is governed by a BSD-style",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Vanilla line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Vanilla > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Vanilla line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Vanilla > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// Copyright 2012 The Gorilla Authors. All rights reserved.",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Vanilla line number 2 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Vanilla > line number 2 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "// Use of this source code is governed by a BSD-style",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions ghe-2.14.11 Vanilla line number 2 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > ghe-2.14.11 > Vanilla > line number 2 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "// Use of this source code is governed by a BSD-style",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Refined Github line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Refined Github > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export const isURL = (value: any): value is URL =>",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Refined Github line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Refined Github > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export const isURL = (value: any): value is URL =>",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Refined Github line number 2 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Refined Github > line number 2 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "!!value && typeof value.toString === 'function' && value.href === value.toString()",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Refined Github line number 2 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Refined Github > line number 2 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "!!value && typeof value.toString === 'function' && value.href === value.toString()",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Vanilla line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Vanilla > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "export const isURL = (value: any): value is URL =>",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Vanilla line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Vanilla > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "export const isURL = (value: any): value is URL =>",
"selector": "TR:nth-child(1) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Vanilla line number 2 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Vanilla > line number 2 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "!!value && typeof value.toString === 'function' && value.href === value.toString()",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",
}
`;
exports[`GitHub DOM functions singleFileDOMFunctions github.com Vanilla line number 2 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitHub DOM functions > singleFileDOMFunctions > github.com > Vanilla > line number 2 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "!!value && typeof value.toString === 'function' && value.href === value.toString()",
"selector": "TR:nth-child(2) > TD.blob-code.blob-code-inner.js-file-line",

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`util parseURL() blob page 1`] = `
exports[`util > parseURL() > blob page 1`] = `
Object {
"pageType": "blob",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -9,7 +9,7 @@ Object {
}
`;
exports[`util parseURL() branch name with forward slashes 1`] = `
exports[`util > parseURL() > branch name with forward slashes 1`] = `
Object {
"pageType": "blob",
"rawRepoName": "ghe.sgdev.org/beyang/mux",
@ -18,7 +18,7 @@ Object {
}
`;
exports[`util parseURL() commit page 1`] = `
exports[`util > parseURL() > commit page 1`] = `
Object {
"pageType": "commit",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -26,7 +26,7 @@ Object {
}
`;
exports[`util parseURL() compare page 1`] = `
exports[`util > parseURL() > compare page 1`] = `
Object {
"pageType": "compare",
"rawRepoName": "github.com/sourcegraph/sourcegraph-basic-code-intel",
@ -34,7 +34,7 @@ Object {
}
`;
exports[`util parseURL() pull request list 1`] = `
exports[`util > parseURL() > pull request list 1`] = `
Object {
"pageType": "other",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -42,7 +42,7 @@ Object {
}
`;
exports[`util parseURL() pull request page 1`] = `
exports[`util > parseURL() > pull request page 1`] = `
Object {
"pageType": "pull",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -50,7 +50,7 @@ Object {
}
`;
exports[`util parseURL() selections - range 1`] = `
exports[`util > parseURL() > selections - range 1`] = `
Object {
"pageType": "blob",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -59,7 +59,7 @@ Object {
}
`;
exports[`util parseURL() selections - single line 1`] = `
exports[`util > parseURL() > selections - single line 1`] = `
Object {
"pageType": "blob",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -68,7 +68,7 @@ Object {
}
`;
exports[`util parseURL() snippet permalink 1`] = `
exports[`util > parseURL() > snippet permalink 1`] = `
Object {
"pageType": "blob",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -77,7 +77,7 @@ Object {
}
`;
exports[`util parseURL() tree page 1`] = `
exports[`util > parseURL() > tree page 1`] = `
Object {
"pageType": "tree",
"rawRepoName": "github.com/sourcegraph/sourcegraph",
@ -86,7 +86,7 @@ Object {
}
`;
exports[`util parseURL() wiki page 1`] = `
exports[`util > parseURL() > wiki page 1`] = `
Object {
"pageType": "other",
"rawRepoName": "github.com/sourcegraph/sourcegraph",

View File

@ -1,9 +1,9 @@
import { existsSync, readdirSync } from 'fs'
import { afterAll, beforeAll, beforeEach, describe, expect, it, test } from '@jest/globals'
import fetch from 'jest-fetch-mock'
import { startCase } from 'lodash'
import { readFile } from 'mz/fs'
import { afterAll, beforeAll, beforeEach, describe, expect, it, test, vi } from 'vitest'
import createFetchMock from 'vitest-fetch-mock'
import { disableFetchCache, enableFetchCache, fetchCache, type LineOrPositionOrRange } from '@sourcegraph/common'
@ -20,6 +20,8 @@ import {
} from './codeHost'
import { windowLocation__testingOnly } from './util'
const fetch = createFetchMock(vi)
const testCodeHost = (fixturePath: string): void => {
if (existsSync(fixturePath)) {
describe('githubCodeHost', () => {

View File

@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it } from '@jest/globals'
import { startCase } from 'lodash'
import type { Omit } from 'utility-types'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { type DOMFunctionsTest, getFixtureBody, testDOMFunctions } from '../shared/codeHostTestUtils'

View File

@ -1,5 +1,5 @@
import { describe, expect, it } from '@jest/globals'
import { readFile } from 'mz/fs'
import { describe, expect, it } from 'vitest'
import { getFilePath, getFilePathFromURL } from './util'

View File

@ -1,5 +1,5 @@
import { describe, expect, test } from '@jest/globals'
import { startCase } from 'lodash'
import { describe, expect, test } from 'vitest'
import { getFixtureBody } from '../shared/codeHostTestUtils'

View File

@ -1,195 +1,195 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 733 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 733 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "TR.line_holder.parallel:nth-child(3) > TD.line_content.parallel.right-side > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 733 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 733 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "TR.line_holder.parallel:nth-child(3) > TD.line_content.parallel.right-side",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 735 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 735 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "TD[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].line_content.parallel.left-side.old > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 735 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 735 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "TR.line_holder.parallel:nth-child(5) > TD.line_content.parallel.left-side.old",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 740 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 740 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "TD[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].line_content.parallel.right-side.new > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Split view line number 740 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Split view > line number 740 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "TR.line_holder.parallel:nth-child(10) > TD.line_content.parallel.right-side.new",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 733 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 733 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_733_733'].line_holder:nth-child(3) > TD.line_content > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 733 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 733 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_733_733'].line_holder:nth-child(3) > TD.line_content",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 735 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 735 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].line_holder.old:nth-child(5) > TD.line_content.old > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 735 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 735 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].line_holder.old:nth-child(5) > TD.line_content.old",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 740 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 740 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].line_holder.new:nth-child(12) > TD.line_content.new > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Legacy Unified view line number 740 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Legacy Unified view > line number 740 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "TR[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].line_holder.new:nth-child(12) > TD.line_content.new",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 733 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 733 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "DIV.diff-grid-row.diff-tr.line_holder.parallel:nth-child(3) > DIV.diff-grid-right.right-side > DIV.diff-td.line_content.with-coverage.right-side.parallel > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 733 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 733 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "DIV.diff-grid-row.diff-tr.line_holder.parallel:nth-child(3) > DIV.diff-grid-right.right-side > DIV.diff-td.line_content.with-coverage.right-side.parallel > SPAN",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 735 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 735 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].diff-td.line_content.with-coverage.left-side.old.parallel > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 735 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 735 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].diff-td.line_content.with-coverage.left-side.old.parallel > SPAN",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 740 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 740 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].diff-td.line_content.with-coverage.right-side.new.parallel > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Split view line number 740 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Split view > line number 740 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].diff-td.line_content.with-coverage.right-side.new.parallel > SPAN",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 733 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 733 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_733_733'].diff-td.line_content.with-coverage.left-side > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 733 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 733 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "defer srv.Close()",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_733_733'].diff-td.line_content.with-coverage.left-side > SPAN",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 735 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 735 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].diff-td.line_content.with-coverage.left-side.old > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 735 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 735 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "u := url.URL{Scheme: \\"ws\\", Host: srv.Listener.Addr().String(), Path: build.Session.Endpoint + \\"/exec\\"}",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_735_735'].diff-td.line_content.with-coverage.left-side.old > SPAN",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 740 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 740 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].diff-td.line_content.with-coverage.left-side.new > SPAN > SPAN.line",
}
`;
exports[`GitLab DOM functions diffDOMFunctions Unified view line number 740 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > diffDOMFunctions > Unified view > line number 740 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "headers := http.Header{",
"selector": "DIV[id='ca8e0332ce17b2ee630a2ee2c0b56d47a462dadf_737_740'].diff-td.line_content.with-coverage.left-side.new > SPAN",
}
`;
exports[`GitLab DOM functions singleFileDOMFunctions line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > singleFileDOMFunctions > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "package shell",
"selector": "SPAN.line:nth-child(1)",
}
`;
exports[`GitLab DOM functions singleFileDOMFunctions line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > singleFileDOMFunctions > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "package shell",
"selector": "SPAN.line:nth-child(1)",
}
`;
exports[`GitLab DOM functions singleFileDOMFunctions line number 22 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`GitLab DOM functions > singleFileDOMFunctions > line number 22 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "type executor struct {",
"selector": "SPAN.line:nth-child(22)",
}
`;
exports[`GitLab DOM functions singleFileDOMFunctions line number 22 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`GitLab DOM functions > singleFileDOMFunctions > line number 22 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "type executor struct {",
"selector": "SPAN.line:nth-child(22)",

View File

@ -1,6 +1,6 @@
import { afterAll, beforeAll, beforeEach, describe, expect, it, test } from '@jest/globals'
import fetch from 'jest-fetch-mock'
import { readFile } from 'mz/fs'
import { afterAll, beforeAll, vi, beforeEach, describe, expect, it, test } from 'vitest'
import createFetchMock from 'vitest-fetch-mock'
import { disableFetchCache, enableFetchCache, fetchCache, type LineOrPositionOrRange } from '@sourcegraph/common'
@ -15,6 +15,8 @@ import {
} from './codeHost'
import { repoNameOnSourcegraph } from './scrape'
const fetch = createFetchMock(vi)
describe('gitlab/codeHost', () => {
describe('gitlabCodeHost', () => {
testMountGetters(gitlabCodeHost, `${__dirname}/__fixtures__/repository.html`)

View File

@ -1,5 +1,5 @@
import { describe } from '@jest/globals'
import { startCase } from 'lodash'
import { describe } from 'vitest'
import { testDOMFunctions } from '../shared/codeHostTestUtils'

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import { getPageKindFromPathName, GitLabPageKind } from './scrape'

View File

@ -1,251 +1,251 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 3 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 3 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "import (",
"selector": "TR:nth-child(3) > TD:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 3 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 3 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "import (",
"selector": "TR:nth-child(3) > TD:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 7 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 7 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "func log() {",
"selector": "TR:nth-child(7) > TD.new.new-full:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 7 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 7 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "func log() {",
"selector": "TR:nth-child(7) > TD.new.new-full:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 10 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 10 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(15) > TD.old:nth-child(2)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Split view, version 2017.09-r1 line number 10 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Split view, version 2017.09-r1 > line number 10 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(15) > TD.old:nth-child(2)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 3 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 3 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "import (",
"selector": "TR:nth-child(3) > TD.right:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 3 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 3 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "import (",
"selector": "TR:nth-child(3) > TD.right:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 7 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 7 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "func log() {",
"selector": "TR:nth-child(7) > TD.right.new:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 7 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 7 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "func log() {",
"selector": "TR:nth-child(7) > TD.right.new:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 10 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 10 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(15) > TD.left.old:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Commit Page Unified view, version 2017.09-r1 line number 10 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Commit Page > Unified view, version 2017.09-r1 > line number 10 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(15) > TD.left.old:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2017.09-r1 line number 9 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2017.09-r1 > line number 9 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": " Println(\\"hello world\\")",
"selector": "TR:nth-child(9) > TD:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2017.09-r1 line number 9 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2017.09-r1 > line number 9 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": " Println(\\"hello world\\")",
"selector": "TR:nth-child(9) > TD:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2017.09-r1 line number 10 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2017.09-r1 > line number 10 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": " fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(10) > TD.new.new-full:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2017.09-r1 line number 10 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2017.09-r1 > line number 10 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": " fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(10) > TD.new.new-full:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 29 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 29 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "resp := &Response{ID: req.ID}",
"selector": "TR:nth-child(5) > TD.annotated",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 29 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 29 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "resp := &Response{ID: req.ID}",
"selector": "TR:nth-child(5) > TD.annotated",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 34 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 34 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "if e, ok := err.(*Error); ok {",
"selector": "TR:nth-child(10) > TD.old.old-full.annotated:nth-child(2)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 34 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 34 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "if e, ok := err.(*Error); ok {",
"selector": "TR:nth-child(10) > TD.old.old-full.annotated:nth-child(2)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "func randoasfasfafsm_1(size int) error {",
"selector": "TR:nth-child(34) > TD.new.new-full.annotated:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Split view, version 2019.21.0-r25 line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Split view, version 2019.21.0-r25 > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "func randoasfasfafsm_1(size int) error {",
"selector": "TR:nth-child(34) > TD.new.new-full.annotated:nth-child(5)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2017.09-r1 line number 9 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2017.09-r1 > line number 9 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "Println(\\"hello world\\")",
"selector": "TR:nth-child(9) > TD.right:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2017.09-r1 line number 9 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2017.09-r1 > line number 9 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "Println(\\"hello world\\")",
"selector": "TR:nth-child(9) > TD.right:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2017.09-r1 line number 10 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2017.09-r1 > line number 10 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(10) > TD.right.new:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2017.09-r1 line number 10 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2017.09-r1 > line number 10 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "fmt.Println(\\"Debug\\")",
"selector": "TR:nth-child(10) > TD.right.new:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 29 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 29 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "resp := &Response{ID: req.ID}",
"selector": "TR:nth-child(5) > TD.right.annotated",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 29 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 29 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "resp := &Response{ID: req.ID}",
"selector": "TR:nth-child(5) > TD.right.annotated",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 34 in base diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 34 in base diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "- if e, ok := err.(*Error); ok {",
"selector": "TR:nth-child(10) > TD.left.old.old-full:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 34 in base diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 34 in base diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "- if e, ok := err.(*Error); ok {",
"selector": "TR:nth-child(10) > TD.left.old.old-full:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 64 in head diff part getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 64 in head diff part > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "+ func randoasfasfafsm_1(size int) error {",
"selector": "TR:nth-child(34) > TD.right.new.new-full:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffDOMFunctions Differential Page Unified view, version 2019.21.0-r25 line number 64 in head diff part getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffDOMFunctions > Differential Page > Unified view, version 2019.21.0-r25 > line number 64 in head diff part > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "+ func randoasfasfafsm_1(size int) error {",
"selector": "TR:nth-child(34) > TD.right.new.new-full:nth-child(4)",
}
`;
exports[`Phabricator DOM functions diffusionDOMFns line number 1 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffusionDOMFns > line number 1 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "package main",
"selector": "TR:nth-child(1) > TD",
}
`;
exports[`Phabricator DOM functions diffusionDOMFns line number 1 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffusionDOMFns > line number 1 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "package main",
"selector": "TR:nth-child(1) > TD",
}
`;
exports[`Phabricator DOM functions diffusionDOMFns line number 10 getCodeElementFromLineNumber() should return the right code element given the line number 1`] = `
exports[`Phabricator DOM functions > diffusionDOMFns > line number 10 > getCodeElementFromLineNumber() > should return the right code element given the line number 1`] = `
Object {
"content": "}",
"selector": "TR:nth-child(10) > TD",
}
`;
exports[`Phabricator DOM functions diffusionDOMFns line number 10 getLineElementFromLineNumber() should return the right line element given the line number 1`] = `
exports[`Phabricator DOM functions > diffusionDOMFns > line number 10 > getLineElementFromLineNumber() > should return the right line element given the line number 1`] = `
Object {
"content": "}",
"selector": "TR:nth-child(10) > TD",

View File

@ -1,4 +1,4 @@
import { describe } from '@jest/globals'
import { describe } from 'vitest'
import { testToolbarMountGetter } from '../shared/codeHostTestUtils'

View File

@ -1,5 +1,5 @@
import { describe } from '@jest/globals'
import { startCase } from 'lodash'
import { describe } from 'vitest'
import { type DOMFunctionsTest, testDOMFunctions } from '../shared/codeHostTestUtils'

View File

@ -1,6 +1,6 @@
import { beforeEach, describe, expect, test } from '@jest/globals'
import { readFile } from 'mz/fs'
import { type Observable, throwError, of } from 'rxjs'
import { beforeEach, describe, expect, test } from 'vitest'
import { resetAllMemoizationCaches } from '@sourcegraph/common'
import type { PlatformContext } from '@sourcegraph/shared/src/platform/context'

View File

@ -1,6 +1,6 @@
import { describe, expect, it } from '@jest/globals'
import { render } from '@testing-library/react'
import { noop } from 'lodash'
import { describe, expect, it } from 'vitest'
import { HTTPStatusError } from '@sourcegraph/http-client'

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`<ViewOnSourcegraphButton /> existence could not be determined because of an authentication failure minimalUI = false renders a sign in button if showSignInButton = true 1`] = `
exports[`<ViewOnSourcegraphButton /> > existence could not be determined > because of an authentication failure > minimalUI = false > renders a sign in button if showSignInButton = true 1`] = `
<DocumentFragment>
<a
aria-label="Sign into Sourcegraph to get hover tooltips, go to definition and more"
@ -33,7 +33,7 @@ exports[`<ViewOnSourcegraphButton /> existence could not be determined because
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> existence could not be determined because of an authentication failure minimalUI = true renders a sign in button if showSignInButton = true 1`] = `
exports[`<ViewOnSourcegraphButton /> > existence could not be determined > because of an authentication failure > minimalUI = true > renders a sign in button if showSignInButton = true 1`] = `
<DocumentFragment>
<a
aria-label="Sign into Sourcegraph to get hover tooltips, go to definition and more"
@ -66,7 +66,7 @@ exports[`<ViewOnSourcegraphButton /> existence could not be determined because
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> existence could not be determined because of an unknown error renders a button with an error label 1`] = `
exports[`<ViewOnSourcegraphButton /> > existence could not be determined > because of an unknown error > renders a button with an error label 1`] = `
<DocumentFragment>
<a
aria-label="Something unknown happened!"
@ -100,7 +100,7 @@ exports[`<ViewOnSourcegraphButton /> existence could not be determined because
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> repository does not exist on the instance renders "Configure Sourcegraph" button when pointing at sourcegraph.com 1`] = `
exports[`<ViewOnSourcegraphButton /> > repository does not exist on the instance > renders "Configure Sourcegraph" button when pointing at sourcegraph.com 1`] = `
<DocumentFragment>
<a
aria-label="The repository does not exist on the configured Sourcegraph instance https://sourcegraph.com"
@ -134,7 +134,7 @@ exports[`<ViewOnSourcegraphButton /> repository does not exist on the instance r
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> repository does not exist on the instance renders a "Repository not found" button when not pointing at sourcegraph.com 1`] = `
exports[`<ViewOnSourcegraphButton /> > repository does not exist on the instance > renders a "Repository not found" button when not pointing at sourcegraph.com 1`] = `
<DocumentFragment>
<a
aria-label="The repository does not exist on the configured Sourcegraph instance https://sourcegraph.test"
@ -168,7 +168,7 @@ exports[`<ViewOnSourcegraphButton /> repository does not exist on the instance r
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> repository exists on the instance renders a link to the repository on the Sourcegraph instance 1`] = `
exports[`<ViewOnSourcegraphButton /> > repository exists on the instance > renders a link to the repository on the Sourcegraph instance 1`] = `
<DocumentFragment>
<a
aria-label="View repository on Sourcegraph"
@ -201,7 +201,7 @@ exports[`<ViewOnSourcegraphButton /> repository exists on the instance renders a
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> repository exists on the instance renders a link with the revision when provided 1`] = `
exports[`<ViewOnSourcegraphButton /> > repository exists on the instance > renders a link with the revision when provided 1`] = `
<DocumentFragment>
<a
aria-label="View repository on Sourcegraph"
@ -234,4 +234,4 @@ exports[`<ViewOnSourcegraphButton /> repository exists on the instance renders a
</DocumentFragment>
`;
exports[`<ViewOnSourcegraphButton /> repository exists on the instance renders nothing in minimal UI mode 1`] = `<DocumentFragment />`;
exports[`<ViewOnSourcegraphButton /> > repository exists on the instance > renders nothing in minimal UI mode 1`] = `<DocumentFragment />`;

View File

@ -1,7 +1,6 @@
import { nextTick } from 'process'
import { promisify } from 'util'
import { afterEach, beforeAll, beforeEach, jest, describe, expect, it, test } from '@jest/globals'
import type { RenderResult } from '@testing-library/react'
import type { Remote } from 'comlink'
import { uniqueId, noop, pick } from 'lodash'
@ -10,6 +9,7 @@ import { take, first } from 'rxjs/operators'
import { TestScheduler } from 'rxjs/testing'
import * as sinon from 'sinon'
import type * as sourcegraph from 'sourcegraph'
import { afterEach, beforeAll, beforeEach, vi, describe, expect, it, test } from 'vitest'
import { resetAllMemoizationCaches, subtypeOf } from '@sourcegraph/common'
import type { SuccessGraphQLResult } from '@sourcegraph/http-client'
@ -53,7 +53,7 @@ const createTestElement = (): HTMLElement => {
return element
}
jest.mock('uuid', () => ({
vi.mock('uuid', () => ({
v4: () => 'uuid',
}))
@ -297,7 +297,7 @@ describe('codeHost', () => {
])
// // Simulate codeView1 removal
mutations.next([{ addedNodes: [], removedNodes: [codeView1] }])
setTimeout(() => mutations.next([{ addedNodes: [], removedNodes: [codeView1] }]))
// One editor should have been removed, model should still exist
await wrapRemoteObservable(extensionHostAPI.viewerUpdates()).pipe(first()).toPromise()
@ -311,7 +311,7 @@ describe('codeHost', () => {
},
])
// // Simulate codeView2 removal
mutations.next([{ addedNodes: [], removedNodes: [codeView2] }])
setTimeout(() => mutations.next([{ addedNodes: [], removedNodes: [codeView2] }]))
// // Second editor and model should have been removed
await wrapRemoteObservable(extensionHostAPI.viewerUpdates()).pipe(first()).toPromise()
expect(getEditors(extensionAPI)).toEqual([])

View File

@ -1,9 +1,9 @@
import assert from 'assert'
import { afterEach, beforeEach, describe, expect, it } from '@jest/globals'
import { readFile } from 'mz/fs'
import Simmer, { type Options as SimmerOptions } from 'simmerjs'
import type { SetIntersection } from 'utility-types'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import type { DiffPart } from '@sourcegraph/codeintellify'

View File

@ -1,8 +1,8 @@
import { beforeEach, describe, expect, it } from '@jest/globals'
import { of } from 'rxjs'
import { toArray } from 'rxjs/operators'
import * as sinon from 'sinon'
import type { Omit } from 'utility-types'
import { beforeEach, describe, expect, it } from 'vitest'
import type { DiffOrBlobInfo } from './codeHost'
import { type CodeView, toCodeViewResolver, trackCodeViews } from './codeViews'

View File

@ -1,8 +1,8 @@
import { afterAll, beforeEach, describe, expect, test } from '@jest/globals'
import { noop } from 'lodash'
import { from, type Observable, of, Subject, Subscription, NEVER } from 'rxjs'
import { bufferCount, map, switchMap, toArray } from 'rxjs/operators'
import * as sinon from 'sinon'
import { afterAll, beforeEach, describe, expect, test } from 'vitest'
import { createBarrier } from '@sourcegraph/testing'

View File

@ -1,4 +1,4 @@
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import { checkIsSourcegraph } from './inject'

View File

@ -1,4 +0,0 @@
// jest-fetch-mock assumes the `jest` global is available, but we use explicit imports from
// `@jest/globals`. This is a workaround to make jest-fetch-mock work. See
// https://github.com/jefflau/jest-fetch-mock/issues/104.
global.jest = require('@jest/globals').jest

View File

@ -1 +0,0 @@
/// <reference types="@testing-library/jest-dom/types/jest-globals" />

View File

@ -0,0 +1,19 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
// TODO(sqs): for some reason, `import '@sourcegraph/testing/src/jestDomMatchers'` does not work (it
// does not extend Assertion with the types).
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers'
import * as matchers from '@testing-library/jest-dom/matchers'
import { expect } from 'vitest'
declare module 'vitest' {
interface Assertion<T = any> extends jest.Matchers<void, T>, TestingLibraryMatchers<T, void> {}
}
expect.extend(matchers)
// MessageChannel is not defined in the Vitest jsdom environment.
if (!global.MessageChannel) {
global.MessageChannel = require('worker_threads').MessageChannel
}

View File

@ -2,9 +2,6 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"paths": {
"*": ["./src/types/*", "../shared/src/types/*", "../common/src/types/*"],
},
"jsx": "react-jsx",
"resolveJsonModule": true,
"rootDir": ".",

View File

@ -0,0 +1,34 @@
import { BAZEL, defineProjectWithDefaults } from '../../vitest.shared'
export default defineProjectWithDefaults(__dirname, {
test: {
environment: 'jsdom',
environmentMatchGlobs: [
// TODO(sqs): can't use jsdom because it breaks simmerjs
// (https://github.com/jsdom/jsdom/issues/3612#issuecomment-1778560104)
['src/**/domFunctions.test.tsx', 'happy-dom'],
['src/shared/code-hosts/bitbucket-cloud/*', 'happy-dom'],
],
experimentalVmThreads: false,
setupFiles: ['src/testSetup.test.ts', '../testing/src/reactCleanup.ts', '../testing/src/fetch.js'],
},
plugins: BAZEL
? [
{
// The github/codeHost.tsx file imports sourcegraph-mark.svg, but this is not
// needed for any tests. Just ignore it.
name: 'no-sourcegrah-mark-svg',
resolveId(id) {
if (id.endsWith('/sourcegraph-mark.svg')) {
return { id, external: true }
}
return undefined
},
},
]
: undefined,
})

View File

@ -32,9 +32,6 @@ ts_project(
"src/paths.ts",
"src/utils/environment-config.ts",
],
data = [
"//:postcss_config_js", #keep
],
tsconfig = ":tsconfig",
deps = [
":node_modules/@types/sass",
@ -46,9 +43,6 @@ ts_project(
":node_modules/postcss-modules",
":node_modules/process", #keep
":node_modules/sass",
# TODO: figure out why is this needed for integration tests even though it's defined in babel_config
"//:node_modules/@babel/runtime", #keep
"//:node_modules/@types/node",
"//:node_modules/monaco-editor", #keep
"//:node_modules/monaco-yaml", #keep

View File

@ -1,13 +0,0 @@
// @ts-check
const config = require('../../jest.config.base')
const exportedConfig = {
...config,
displayName: 'build-config',
rootDir: __dirname,
roots: ['<rootDir>'],
verbose: true,
}
module.exports = exportedConfig

View File

@ -8,7 +8,7 @@
"license": "Apache-2.0",
"scripts": {
"lint:js": "eslint --cache 'src/**/*.[jt]s?(x)'",
"test": "jest"
"test": "echo no tests"
},
"devDependencies": {
"@types/sass": "1.16.1"

View File

@ -46,8 +46,8 @@ ts_project(
deps = [
":client-api_lib",
":node_modules/@sourcegraph/extension-api-types",
"//:node_modules/@jest/globals",
"//:node_modules/@sourcegraph/extension-api-classes",
"//:node_modules/vitest",
],
)

View File

@ -1,13 +0,0 @@
// @ts-check
const config = require('../../jest.config.base')
const exportedConfig = {
...config,
displayName: 'client-api',
rootDir: __dirname,
roots: ['<rootDir>'],
verbose: true,
}
module.exports = exportedConfig

View File

@ -8,7 +8,7 @@
"license": "Apache-2.0",
"scripts": {
"lint:js": "eslint --cache 'src/**/*.[jt]s?(x)'",
"test": "jest"
"test": "vitest"
},
"devDependencies": {
"@sourcegraph/extension-api-types": "workspace:*",

View File

@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals'
import { describe, expect, test } from 'vitest'
import { MarkupKind } from '@sourcegraph/extension-api-classes'
import type { Range } from '@sourcegraph/extension-api-types'

View File

@ -6,10 +6,6 @@
"sourceRoot": "src",
"rootDir": ".",
"outDir": "./out",
"baseUrl": "./src",
"paths": {
"*": ["../common/src/types/*"],
},
},
"references": [
{

View File

@ -0,0 +1,3 @@
import { defineProjectWithDefaults } from '../../vitest.shared'
export default defineProjectWithDefaults(__dirname, { test: {} })

View File

@ -1,6 +1,6 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//dev:defs.bzl", "jest_test", "npm_package", "ts_project")
load("//dev:defs.bzl", "npm_package", "ts_project", "vitest_test")
load("//dev:eslint.bzl", "eslint_config_and_lint_root")
npm_link_all_packages(name = "node_modules")
@ -51,12 +51,12 @@ ts_project(
"src/loading.test.ts",
"src/overlayPosition.test.ts",
"src/positions.test.ts",
"src/testSetup.test.ts",
"src/testutils/dom.test.ts",
"src/testutils/dom.ts",
"src/testutils/fixtures.ts",
"src/testutils/generate.ts",
"src/testutils/github/generate.ts",
"src/testutils/globals.d.ts",
"src/testutils/mouse.ts",
"src/testutils/revision.ts",
"src/testutils/sourcegraph/generate.ts",
@ -72,12 +72,13 @@ ts_project(
":codeintellify_lib",
":node_modules/@sourcegraph/common",
":node_modules/@sourcegraph/extension-api-types",
"//:node_modules/@jest/globals",
":node_modules/@sourcegraph/testing",
"//:node_modules/@testing-library/jest-dom", #keep
"//:node_modules/@types/lodash",
"//:node_modules/@types/node",
"//:node_modules/lodash",
"//:node_modules/rxjs",
"//:node_modules/vitest",
],
)
@ -89,7 +90,7 @@ npm_package(
],
)
jest_test(
vitest_test(
name = "test",
data = [
":codeintellify_tests",

View File

@ -1,13 +0,0 @@
// @ts-check
const config = require('../../jest.config.base')
const exportedConfig = {
...config,
displayName: 'codeintellify',
rootDir: __dirname,
roots: ['<rootDir>'],
verbose: true,
}
module.exports = exportedConfig

Some files were not shown because too many files have changed in this diff Show More