MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / confirmBlueprinted

Function confirmBlueprinted

tests/acceptance/init-test.js:54–93  ·  view source on GitHub ↗
(typescript = false)

Source from the content-addressed store, hash-verified

52 });
53
54 function confirmBlueprinted(typescript = false) {
55 if (isExperimentEnabled('VITE')) {
56 confirmViteBlueprint();
57 return;
58 }
59
60 let blueprintPath = path.join(path.dirname(require.resolve('@ember-tooling/classic-build-app-blueprint')), 'files');
61 // ignore TypeScript files
62 let expected = walkSync(blueprintPath, {
63 ignore: ['tsconfig.json', 'types', 'app/config'],
64 }).map((name) => (typescript ? name : name.replace(/\.ts$/, '.js')));
65
66 // This style of assertion can't handle conditionally available files
67 if (expected.some((x) => x.endsWith('eslint.config.mjs'))) {
68 expected = [...expected.filter((x) => !x.endsWith('eslint.config.mjs')), 'eslint.config.mjs'];
69 }
70 // GJS and GTS files are also conditionally available
71 expected = expected.filter((x) => !x.endsWith('.gjs') && !x.endsWith('.gts'));
72
73 expected.sort();
74
75 let actual = walkSync('.').sort();
76
77 Object.keys(Blueprint.renamedFiles).forEach((srcFile) => {
78 expected[expected.indexOf(srcFile)] = Blueprint.renamedFiles[srcFile];
79 });
80
81 removeIgnored(expected);
82 removeIgnored(actual);
83
84 removeTmp(expected);
85 removeTmp(actual);
86
87 expected.sort();
88
89 expect(expected).to.deep.equal(
90 actual,
91 `${EOL} expected: ${util.inspect(expected)}${EOL} but got: ${util.inspect(actual)}`
92 );
93 }
94
95 function confirmGlobBlueprinted(pattern) {
96 let blueprintPath = path.join(path.dirname(require.resolve('@ember-tooling/classic-build-app-blueprint')), 'files');

Callers 1

init-test.jsFile · 0.85

Calls 4

confirmViteBlueprintFunction · 0.85
removeIgnoredFunction · 0.85
removeTmpFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…