Skip to content

Commit

Permalink
test in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Sep 18, 2024
1 parent 5f70b4b commit 27a7708
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions tests/scenarios/vite-internals-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { appScenarios, baseAddon } from './scenarios';
import { baseAddon, tsAppScenarios } from './scenarios';
import type { PreparedApp } from 'scenario-tester';
import QUnit from 'qunit';
import fetch from 'node-fetch';
Expand All @@ -7,7 +7,7 @@ import { setupAuditTest } from '@embroider/test-support/audit-assertions';

const { module: Qmodule, test } = QUnit;

appScenarios
tsAppScenarios
.only('release')
.map('vite-internals', app => {
// These are for a custom testem setup that will let us do runtime tests
Expand Down Expand Up @@ -54,10 +54,10 @@ appScenarios

app: {
components: {
'alpha.js': `
'alpha.ts': `
import Component from '@glimmer/component';
export default class extends Component {
message = "alpha";
message: string = "alpha";
}
`,
'alpha.hbs': `
Expand All @@ -76,6 +76,15 @@ appScenarios
`,
'epsilon.hbs': `<div class="epsilon">Epsilon</div>`,
'fancy-button.hbs': `<h1>I'm fancy</h1>`,
'fancy-gts.gts': `
import Component from '@glimmer/component';
export default class extends Component {
message: string = "gts";
<template>
<h1>I'm fancy Gts</h1>
</template>
}
`,
},
templates: {
'application.hbs': `
Expand All @@ -84,6 +93,7 @@ appScenarios
`,
'index.hbs': `
<FancyButton />
<FancyGts />
<WelcomePage />
`,
},
Expand All @@ -103,12 +113,13 @@ appScenarios
components: {
'example-test.js': `
import { module, test } from 'qunit';
import { setupRenderingTest } from 'app-template/tests/helpers';
import { setupRenderingTest } from 'ts-app-template/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { appLibOne as libOneViaAddon, appLibTwo as libTwoViaAddon } from 'app-template/v1-example-addon';
import appLibOne from 'app-template/lib/app-lib-one';
import appLibTwo from 'app-template/lib/app-lib-two';
import { appLibOne as libOneViaAddon, appLibTwo as libTwoViaAddon } from 'ts-app-template/v1-example-addon';
import appLibOne from 'ts-app-template/lib/app-lib-one';
import appLibTwo from 'ts-app-template/lib/app-lib-two';
module('Integration | Component | example', function (hooks) {
setupRenderingTest(hooks);
Expand Down Expand Up @@ -176,7 +187,7 @@ appScenarios
app: {
'v1-example-addon.js': `
import appLibOne from './lib/app-lib-one';
import appLibTwo from 'app-template/lib/app-lib-two';
import appLibTwo from 'ts-app-template/lib/app-lib-two';
export { appLibOne, appLibTwo };
`,
components: {
Expand Down Expand Up @@ -222,7 +233,7 @@ appScenarios
.module('./index.html')
.resolves(/\/index.html.*/) // in-html app-boot script
.toModule()
.resolves(/\/app\.js.*/)
.resolves(/\/app\.ts.*/)
.toModule()
.resolves(/.*\/-embroider-entrypoint.js/)
.toModule()
Expand Down

0 comments on commit 27a7708

Please sign in to comment.