-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Open in IDE button for block and hook definitions in Runner UI #30859
Changes from 10 commits
237c825
6106400
877d8b2
c92a883
84519d6
d99c450
f137526
6cedebc
c6c9d28
edd10e7
21a757e
921d67f
f406080
da40a47
e06a2c4
03c0865
6d580b0
b3018b4
6c2ded8
30d0f45
cc42d8c
475fbfa
d0d7993
bce0e55
0c38ce9
4996e11
2234703
15ed6aa
b5490b3
f70871b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ | |
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude cypress-tests.ts,*only.cy.js", | ||
"stop-only-all": "yarn stop-only --folder packages", | ||
"pretest": "yarn ensure-deps", | ||
"test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,electron,errors,extension,https-proxy,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry} --scope=@tooling/{electron-mksnapshot,v8-snapshot}", | ||
"test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,driver,electron,errors,extension,https-proxy,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry} --scope=@tooling/{electron-mksnapshot,v8-snapshot}", | ||
"test-debug": "lerna exec yarn test-debug --ignore=@packages/{driver,root,static,web-config}", | ||
"test-integration": "lerna exec yarn test-integration --ignore=@packages/{driver,root,static,web-config}", | ||
"test-mocha": "mocha --reporter spec scripts/spec.js", | ||
|
@@ -278,5 +278,6 @@ | |
"devtools-protocol": "0.0.1346313", | ||
"sharp": "0.29.3", | ||
"vue-template-compiler": "2.6.12" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ export default (Commands, Cypress, cy, state) => { | |
const scrollIntoView = () => { | ||
return new Promise((resolve, reject) => { | ||
// scroll our axes | ||
// @ts-expect-error - scrollTo does not define a 'done()' key on its config object. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure of why this was newly causing a The config to |
||
return $(options.$parent).scrollTo(options.$el, { | ||
axis: options.axis, | ||
easing: options.easing, | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* @vitest-environment jsdom | ||
*/ | ||
import { vi, describe, it, expect, beforeEach } from 'vitest' | ||
|
||
import source_map_utils from '../../../src/cypress/source_map_utils' | ||
import stack_utils from '../../../src/cypress/stack_utils' | ||
import stackFrameFixture from './__fixtures__/spec_stackframes.json' | ||
|
||
vi.mock('../../../src/cypress/source_map_utils', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could have been left unmocked, with the return value of |
||
return { | ||
default: { | ||
getSourcePosition: vi.fn(), | ||
}, | ||
} | ||
}) | ||
|
||
describe('stack_utils', () => { | ||
beforeEach(() => { | ||
// @ts-expect-error | ||
global.Cypress = { | ||
config: vi.fn(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The results of this function call are inconsequential to the logic under test, but the lack of a global |
||
} | ||
|
||
vi.resetAllMocks() | ||
}) | ||
|
||
describe('getInvocationDetails', () => { | ||
const { line, column, scenarios } = stackFrameFixture | ||
|
||
const projectRoot = '/foo/bar' | ||
|
||
let stack: string | ||
|
||
class MockError { | ||
get stack () { | ||
return stack | ||
} | ||
} | ||
const config = () => projectRoot | ||
|
||
for (const scenario of scenarios) { | ||
const { browser, build, specFrame, stack: scenarioStack } = scenario | ||
|
||
describe(`${browser}:${build}`, () => { | ||
beforeEach(() => { | ||
stack = scenarioStack | ||
}) | ||
|
||
it('calls getSourcePosition with the correct file, line, and column', () => { | ||
stack_utils.getInvocationDetails( | ||
{ Error: MockError, Cypress: {} }, | ||
config, | ||
) | ||
|
||
// getSourcePosition is not called directly from getInvocationDetails, but via: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This indirect call of the spied upon function does introduce brittleness to this test. It will not pass if the underlying implementation is changed. We should consider refactoring stack analysis, especially for user invocation codepoints, to standard patterns to ease testing flexibility. |
||
// - getSourceDetailsForFirstLine | ||
// - getSourceDetailsForLine | ||
expect(source_map_utils.getSourcePosition).toHaveBeenCalledWith(specFrame, expect.objectContaining({ | ||
column, | ||
line, | ||
file: specFrame, | ||
})) | ||
}) | ||
}) | ||
} | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
include: ['test/unit/**/*.spec.ts'], | ||
environment: 'jsdom', | ||
exclude: ['**/__fixtures__/**/*'], | ||
reporters: [ | ||
'default', | ||
['junit', { suiteName: 'Driver Unit Tests', outputFile: '/tmp/cypress/junit/driver-test-results.xml' }], | ||
], | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this deserves an entry in the changelog since it was never released. I would just mark this as a
chore
without a changelog entry.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in f70871b