MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / fullHelper

Function fullHelper

test/unit/utils/trace_test.js:268–281  ·  view source on GitHub ↗
(overrides = {})

Source from the content-addressed store, hash-verified

266 afterEach(() => rmDir(dir))
267
268 function fullHelper(overrides = {}) {
269 return {
270 grabCurrentUrl: sinon.stub().resolves('https://example.com/'),
271 saveScreenshot: sinon.stub().callsFake(async file => fs.writeFileSync(file, 'fake-png')),
272 grabSource: sinon.stub().resolves('<html><body><div>hi</div></body></html>'),
273 grabAriaSnapshot: sinon.stub().resolves('main\n - text "hi"'),
274 grabBrowserLogs: sinon.stub().resolves(['log line']),
275 grabStorageState: sinon.stub().resolves({
276 cookies: [{ name: 'sid', value: 'abc' }],
277 origins: [{ origin: 'https://example.com', localStorage: [{ name: 'k', value: 'v' }] }],
278 }),
279 ...overrides,
280 }
281 }
282
283 it('returns empty object when helper is null/undefined', async () => {
284 expect(await captureSnapshot(null, { dir })).to.deep.equal({})

Callers 1

trace_test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected