|
1 | 1 | const e2e = require('../support/helpers/e2e').default |
| 2 | +const { fs } = require('../../lib/util/fs') |
| 3 | +const path = require('path') |
2 | 4 | const Fixtures = require('../support/helpers/fixtures') |
3 | 5 |
|
4 | 6 | describe('e2e config', () => { |
@@ -55,9 +57,37 @@ describe('e2e config', () => { |
55 | 57 | }) |
56 | 58 | }) |
57 | 59 |
|
| 60 | + it('supports custom configFile in TypeScript', function () { |
| 61 | + return e2e.exec(this, { |
| 62 | + project: Fixtures.projectPath('config-with-custom-file-ts'), |
| 63 | + configFile: 'cypress.config.custom.ts', |
| 64 | + }) |
| 65 | + }) |
| 66 | + |
58 | 67 | it('supports custom configFile in a default JavaScript file', function () { |
59 | 68 | return e2e.exec(this, { |
60 | 69 | project: Fixtures.projectPath('config-with-js'), |
61 | 70 | }) |
62 | 71 | }) |
| 72 | + |
| 73 | + it('supports custom configFile in a default TypeScript file', function () { |
| 74 | + return e2e.exec(this, { |
| 75 | + project: Fixtures.projectPath('config-with-ts'), |
| 76 | + }) |
| 77 | + }) |
| 78 | + |
| 79 | + it('throws error when multiple default config file are found in project', function () { |
| 80 | + const projectRoot = Fixtures.projectPath('pristine') |
| 81 | + |
| 82 | + return Promise.all([ |
| 83 | + fs.writeFile(path.join(projectRoot, 'cypress.config.js'), 'module.exports = {}'), |
| 84 | + fs.writeFile(path.join(projectRoot, 'cypress.config.ts'), 'export default {}'), |
| 85 | + ]).then(() => { |
| 86 | + return e2e.exec(this, { |
| 87 | + project: projectRoot, |
| 88 | + expectedExitCode: 1, |
| 89 | + snapshot: true, |
| 90 | + }) |
| 91 | + }) |
| 92 | + }) |
63 | 93 | }) |
0 commit comments