| 54 | } |
| 55 | |
| 56 | const getEncryptionFileSource = async (encryptionFilePath) => { |
| 57 | const fileContents = await fs.readFile(encryptionFilePath, 'utf8') |
| 58 | |
| 59 | if (!fileContents.includes(`test: CY_TEST,`)) { |
| 60 | throw new Error(`Expected to find test key in cloud encryption file`) |
| 61 | } |
| 62 | |
| 63 | return fileContents.replace(`test: CY_TEST,`, '').replace(/const CY_TEST = `(.*?)`/, '') |
| 64 | } |
| 65 | |
| 66 | const validateEncryptionFile = async (encryptionFilePath) => { |
| 67 | const afterReplaceEncryption = await fs.readFile(encryptionFilePath, 'utf8') |