Skip to content

Commit edaa48d

Browse files
committedMar 7, 2025
Fix lints
1 parent 3cb448a commit edaa48d

File tree

8 files changed

+50
-41
lines changed

8 files changed

+50
-41
lines changed
 

‎apps/tutorial/app/components/selection.gts

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class Selection extends Component {
3131

3232
isSelected = (group: { path: string }, tutorial: { path: string }) => {
3333
const fullPath = `/${group.path}/${tutorial.path}`;
34+
3435
return this.docs.currentPath === fullPath;
3536
};
3637

‎apps/tutorial/app/config/environment.d.ts

-15
This file was deleted.

‎apps/tutorial/app/config/environment.js

-22
This file was deleted.
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2+
// @ts-expect-error
3+
import { getGlobalConfig } from '@embroider/macros/src/addon/runtime';
4+
5+
interface Config {
6+
isTesting?: boolean;
7+
environment: string;
8+
modulePrefix: string;
9+
podModulePrefix?: string;
10+
locationType: 'history' | 'hash' | 'none' | 'auto';
11+
rootURL: string;
12+
EmberENV?: Record<string, unknown>;
13+
APP: Record<string, unknown> & { rootElement?: string; autoboot?: boolean };
14+
}
15+
16+
const ENV: Config = {
17+
modulePrefix: 'tutorial',
18+
environment: import.meta.env.DEV ? 'development' : 'production',
19+
rootURL: '/',
20+
locationType: 'history',
21+
EmberENV: {},
22+
APP: {},
23+
};
24+
25+
export default ENV;
26+
27+
export function enterTestMode() {
28+
ENV.locationType = 'none';
29+
ENV.APP.rootElement = '#ember-testing';
30+
ENV.APP.autoboot = false;
31+
32+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
33+
const config = getGlobalConfig()['@embroider/macros'];
34+
35+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
36+
if (config) config.isTesting = true;
37+
}

‎apps/tutorial/tests/helpers/mocks.ts

+2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ function makeDocsTree(treeData: [string, string[]][]) {
3939

4040
groupPages.push(page);
4141
}
42+
4243
const group = {
4344
path: groupPath,
4445
name: groupName,
4546
cleanedName: groupName.replace(/-/g, ' '),
4647
pages: groupPages,
4748
first: `/${groupPath}/${groupPages[0]?.path}/prose.md`,
4849
};
50+
4951
pages.push(group);
5052
}
5153

‎apps/tutorial/tests/integration/components/selection-test.gts

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import { module, test } from 'qunit';
2-
import { setupRenderingTest } from 'tutorial/tests/helpers';
31
import { render, select } from '@ember/test-helpers';
2+
import { module, test } from 'qunit';
3+
44
import { Selection } from 'tutorial/components/selection';
5+
import { setupRenderingTest } from 'tutorial/tests/helpers';
6+
57
import { MockDocsService, MockRouterService } from '../../helpers/mocks';
68

79
module('Integration | Component | selection', function (hooks) {
810
setupRenderingTest(hooks);
911

10-
hooks.beforeEach(function (assert) {
12+
hooks.beforeEach(function () {
1113
this.owner.register('service:docs', MockDocsService);
1214
this.owner.register('service:router', MockRouterService);
1315
});
1416

1517
test('it renders groups and options', async function (assert) {
1618
const docsSvc = this.owner.lookup('service:docs') as unknown as MockDocsService;
19+
1720
docsSvc._setGroupsData([
1821
[
1922
'1-introduction',
@@ -44,8 +47,11 @@ module('Integration | Component | selection', function (hooks) {
4447

4548
test('it handles selection', async function (assert) {
4649
const routerSvc = this.owner.lookup('service:router') as unknown as MockRouterService;
50+
4751
routerSvc._setAssert(assert);
52+
4853
const docsSvc = this.owner.lookup('service:docs') as unknown as MockDocsService;
54+
4955
docsSvc._setGroupsData([
5056
['english', ['one', 'two', 'three']],
5157
['spanish', ['uno', 'dos', 'tres']],
File renamed without changes.

‎apps/tutorial/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"tutorial/*": ["./app/*"],
1515
"*": ["./types/*"]
1616
},
17-
"types": ["ember-source/types", "@embroider/core/virtual"]
17+
"types": ["vite/client", "ember-source/types", "@embroider/core/virtual"]
1818
},
1919
"include": ["app/**/*", "tests/**/*", "types/**/*"]
2020
}

0 commit comments

Comments
 (0)
Failed to load comments.