(blueprintDir, expectedAppDir = 'foo', typescript = false)
| 32 | let tmpDir; |
| 33 | |
| 34 | function confirmBlueprintedForDir(blueprintDir, expectedAppDir = 'foo', typescript = false) { |
| 35 | let blueprintPath = path.join(blueprintDir, 'files'); |
| 36 | // ignore TypeScript files |
| 37 | let expected = walkSync(blueprintPath, { |
| 38 | ignore: ['tsconfig.json', 'types', 'app/config'], |
| 39 | }).map((name) => (typescript ? name : name.replace(/\.ts$/, '.js'))); |
| 40 | |
| 41 | // This style of assertion can't handle conditionally available files |
| 42 | if (expected.some((x) => x.endsWith('eslint.config.mjs'))) { |
| 43 | expected = [...expected.filter((x) => !x.endsWith('eslint.config.mjs')), 'eslint.config.mjs']; |
| 44 | } |
| 45 | // GJS and GTS files are also conditionally available |
| 46 | expected = expected.filter((x) => !x.endsWith('.gjs') && !x.endsWith('.gts')); |
| 47 | |
| 48 | let actual = walkSync('.').sort(); |
| 49 | let directory = path.basename(process.cwd()); |
| 50 | |
| 51 | Object.keys(Blueprint.renamedFiles).forEach((srcFile) => { |
| 52 | expected[expected.indexOf(srcFile)] = Blueprint.renamedFiles[srcFile]; |
| 53 | }); |
| 54 | |
| 55 | expected.sort(); |
| 56 | |
| 57 | // since the test is quite dynamic we want to make sure that the |
| 58 | // directory and the expected aren't empty |
| 59 | expect(directory).to.not.be.empty; |
| 60 | expect(expected).to.not.be.empty; |
| 61 | |
| 62 | expect(directory).to.equal(expectedAppDir); |
| 63 | expect(expected).to.deep.equal( |
| 64 | actual, |
| 65 | `${EOL} expected: ${util.inspect(expected)}${EOL} but got: ${util.inspect(actual)}` |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | describe('Acceptance: ember new', function () { |
| 70 | this.timeout(300000); |
no test coverage detected
searching dependent graphs…