Skip to content

Commit

Permalink
fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Sep 16, 2024
1 parent f7656a3 commit 572989e
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions tests/scenarios/vite-internals-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ appScenarios
`,
'epsilon.hbs': `<div class="epsilon">Epsilon</div>`,
'fancy-button.hbs': `<h1>I'm fancy</h1>`,
'delta.js': `
import Component from '@glimmer/component';
export default class extends Component {
message = "delta";
}
`
},
templates: {
'application.hbs': `
Expand All @@ -90,11 +96,17 @@ appScenarios
lib: {
'app-lib-one.js': `
globalThis.appLibOneLoaded = (globalThis.appLibOneLoaded ?? 0) + 1;
export default function() { return 'app-lib-one'; }
const localObject = {
message: 'app-lib-one'
};
export default function() { return localObject; }
`,
'app-lib-two.js': `
globalThis.appLibTwoLoaded = (globalThis.appLibTwoLoaded ?? 0) + 1;
export default function() { return 'app-lib-two'; }
const localObject = {
message: 'app-lib-two'
};
export default function() { return localObject; }
`,
},
},
Expand Down Expand Up @@ -136,6 +148,11 @@ appScenarios
assert.dom('.epsilon').hasText('Epsilon');
});
test("paired component between app and addon", async function (assert) {
await render(hbs\`<Delta />\`);
assert.dom('.delta').hasText('delta');
});
test("addon depends on an app's module via relative import", async function (assert) {
assert.strictEqual(appLibOne(), libOneViaAddon(), 'lib one works the same');
assert.strictEqual(globalThis.appLibOneLoaded, 1, 'app lib one loaded once');
Expand Down Expand Up @@ -179,6 +196,13 @@ appScenarios
import appLibTwo from 'app-template/lib/app-lib-two';
export { appLibOne, appLibTwo };
`,
templates: {
components: {
'delta.hbs': `
<div class="delta">delta</div>
`,
},
},
components: {
'beta.js': `
export { default } from 'v1-example-addon/components/beta';
Expand Down

0 comments on commit 572989e

Please sign in to comment.