Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Apr 3, 2024
1 parent e0145ff commit 90a8cad
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/scenarios/compat-exclude-dot-files-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ appScenarios
// but not be picked up in the entrypoint
expectAudit
.module('./node_modules/.embroider/rewritten-app/index.html')
.resolves('./assets/app-template.js')
.resolves('./@embroider/core/entrypoint')
.toModule()
.withContents(content => {
assert.notOk(/app-template\/\.foobar/.test(content), '.foobar is not in the entrypoint');
Expand Down
38 changes: 32 additions & 6 deletions tests/scenarios/compat-namespaced-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ appScenarios
expectFile = expectRewrittenFilesAt(app.dir, { qunit: assert });
});

test(`imports within app js`, function () {
test(`imports within app js`, function (assert) {
expectAudit
.module('./node_modules/.embroider/rewritten-app/index.html')
.resolves('./assets/@ef4/namespaced-app.js')
.resolves('./@embroider/core/entrypoint')
.toModule()
.resolves('./-embroider-implicit-modules.js')
.toModule()
Expand All @@ -53,10 +53,36 @@ appScenarios

expectAudit
.module('./node_modules/.embroider/rewritten-app/index.html')
.resolves('./assets/@ef4/namespaced-app.js')
.toModule().codeContains(`d("@ef4/namespaced-app/templates/application", function () {
return i("@ef4/namespaced-app/templates/application.hbs");
});`);
.resolves('./@embroider/core/entrypoint')
.toModule()
.withContents(contents => {
const results =
/import \* as (\w+) from "@embroider-dep\/@ef4\/namespaced-app\/templates\/application.hbs"/.exec(
contents
);

if (!results || !results[1]) {
return false;
}

assert.codeContains(
contents,
`d("@ef4/namespaced-app/templates/application", function () {
return ${results[1]};
});`
);

return true;
});

// .codeContains(`d("@ef4/namespaced-app/templates/application", function () {
// return i("@ef4/namespaced-app/templates/application.hbs");
// });`);

// import * as amdModule16 from "@embroider-dep/@ef4/namespaced-app/templates/application.hbs";
// d("@ef4/namespaced-app/templates/application", function () {
// return amdModule16;
// });
});

test(`app css location`, function () {
Expand Down

0 comments on commit 90a8cad

Please sign in to comment.