Skip to content

Commit ab8ff9a

Browse files
committed
fix(typescript): test-support types path
1 parent ef9a91e commit ab8ff9a

File tree

7 files changed

+57
-15
lines changed

7 files changed

+57
-15
lines changed

packages/ember-simple-auth/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
},
107107
"./test-support": {
108108
"default": "./dist/test-support/index.js",
109-
"types": "./declarations/test-support/*.d.ts"
109+
"types": "./declarations/test-support/index.d.ts"
110110
},
111111
"./utils/*": {
112112
"default": "./dist/utils/*.js",
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare const config: {
2+
apiHost: string;
3+
APP: string;
4+
modulePrefix: string;
5+
podModulePrefix: string;
6+
};
7+
8+
export default config;

packages/test-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@glint/environment-ember-template-imports": "1.5.0",
3333
"@tsconfig/ember": "3.0.8",
3434
"@types/ember__service": "4.0.9",
35+
"@types/qunit": "^2.19.12",
3536
"@typescript-eslint/eslint-plugin": "8.19.0",
3637
"@typescript-eslint/parser": "8.19.0",
3738
"body-parser": "1.20.3",

packages/test-app/tests/acceptance/authentication-test.js packages/test-app/tests/acceptance/authentication-test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {
77
authenticateSession,
88
currentSession,
99
} from 'ember-simple-auth/test-support';
10-
import config from '../../config/environment';
10+
import config from 'test-app/config/environment';
1111

1212
module('Acceptance: Authentication', function (hooks) {
1313
setupApplicationTest(hooks);
14-
let server;
14+
let server: Pretender;
1515

1616
hooks.afterEach(function () {
1717
if (server) {
@@ -85,7 +85,7 @@ module('Acceptance: Authentication', function (hooks) {
8585
});
8686

8787
await visit('/');
88-
await authenticateSession({ userId: 1, otherData: 'some-data' });
88+
await authenticateSession({ userId: '1', otherData: 'some-data' });
8989
await visit('/protected');
9090

9191
let session = currentSession();
@@ -133,7 +133,7 @@ module('Acceptance: Authentication', function (hooks) {
133133
'{"data":[]}',
134134
]);
135135
});
136-
await authenticateSession({ userId: 1, otherData: 'some-data' });
136+
await authenticateSession({ userId: '1', otherData: 'some-data' });
137137
await visit('/engine/protected');
138138

139139
assert.equal(currentURL(), '/engine/protected');
@@ -150,7 +150,7 @@ module('Acceptance: Authentication', function (hooks) {
150150
'{"data":[]}',
151151
]);
152152
});
153-
await authenticateSession({ userId: 1, otherData: 'some-data' });
153+
await authenticateSession({ userId: '1', otherData: 'some-data' });
154154
await visit('/engine/protected');
155155
await click('[data-test-logout-button]');
156156

@@ -168,7 +168,7 @@ module('Acceptance: Authentication', function (hooks) {
168168
'{"data":[]}',
169169
]);
170170
});
171-
await authenticateSession({ userId: 1, otherData: 'some-data' });
171+
await authenticateSession({ userId: '1', otherData: 'some-data' });
172172
await visit('/engine/open-only');
173173

174174
assert.equal(currentURL(), '/');
@@ -191,7 +191,7 @@ module('Acceptance: Authentication', function (hooks) {
191191
});
192192

193193
test('cannot be visited when the session is authenticated', async function (assert) {
194-
await authenticateSession();
194+
await authenticateSession({});
195195
await visit('/login');
196196

197197
assert.equal(currentURL(), '/');
File renamed without changes.

pnpm-lock.yaml

+40-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)