MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / fixture

Function fixture

javascript/selenium-manager/test/index_test.js:33–46  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

31const INDEX = path.join(__dirname, '..', 'index.js')
32
33function fixture(t) {
34 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'selenium-manager-'))
35 t.after(() => fs.rmSync(root, { recursive: true, force: true }))
36 const shim = path.join(root, 'platform-shim.js')
37 fs.writeFileSync(
38 shim,
39 `Object.defineProperty(process, 'platform', { value: process.env.FAKE_PLATFORM })
40Object.defineProperty(process, 'arch', { value: process.env.FAKE_ARCH })
41`,
42 )
43 const modules = path.join(root, 'node_modules')
44 fs.mkdirSync(modules)
45 return { root, shim, modules }
46}
47
48function installPackage(modules, name, binary) {
49 const dir = path.join(modules, ...name.split('/'))

Callers 1

index_test.jsFile · 0.85

Calls 1

afterMethod · 0.80

Tested by

no test coverage detected