MCPcopy Create free account
hub / github.com/cypress-io/cypress / getProtocolFileSource

Function getProtocolFileSource

scripts/binary/binary-sources.js:102–110  ·  view source on GitHub ↗
(protocolFilePath)

Source from the content-addressed store, hash-verified

100}
101
102const getProtocolFileSource = async (protocolFilePath) => {
103 const fileContents = await fs.readFile(protocolFilePath, 'utf8')
104
105 if (!fileContents.includes('process.env.CYPRESS_LOCAL_PROTOCOL_PATH')) {
106 throw new Error(`Expected to find CYPRESS_LOCAL_PROTOCOL_PATH in protocol file`)
107 }
108
109 return fileContents.replaceAll('process.env.CYPRESS_LOCAL_PROTOCOL_PATH', 'undefined')
110}
111
112const getStudioFileSource = async (studioFilePath) => {
113 const fileContents = await fs.readFile(studioFilePath, 'utf8')

Callers 1

after-pack-hook.jsFile · 0.85

Calls 1

readFileMethod · 0.80

Tested by

no test coverage detected