Skip to content

Commit 55a5253

Browse files
author
Vieltojarvi
committed
fixed seed e2e tests
1 parent 252b150 commit 55a5253

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

packages/integration-tests/src/test-project-setup/seed_test_project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class SeedTestProject extends TestProjectBase {
171171
backendId: BackendIdentifier,
172172
): Promise<void> {
173173
await super.assertPostDeployment(backendId);
174-
const testUsername = 'testUser@testing.com';
174+
const testUsername = 'testUser@amazon.com';
175175
const clientConfig = await generateClientConfig(backendId, '1.3');
176176

177177
if (!clientConfig.auth) {

packages/integration-tests/src/test-projects/seed-test-project/amplify/seed/seed.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import * as auth from 'aws-amplify/auth';
33
import type { Schema } from './../data/resource.js';
44
import { Amplify } from 'aws-amplify';
55
import { generateClient } from 'aws-amplify/api';
6-
// @ts-expect-error this file will not exist until sandbox is created
7-
import outputs from '../../amplify_outputs.json';
6+
// @ts-ignore this file will not exist until sandbox is created
7+
// import outputs from '../../amplify_outputs.json';
88
import { SemVer } from 'semver';
99
import crypto from 'node:crypto';
10+
import path from 'node:path';
11+
import { fileURLToPath } from 'node:url';
12+
import { readFile } from 'node:fs/promises';
1013

1114
// TODO: this is a work around - in theory this should be fixed
1215
// it seems like as of amplify v6 , some of the code only runs in the browser ...
@@ -19,6 +22,14 @@ if (process.versions.node) {
1922
}
2023
}
2124

25+
const filename = fileURLToPath(import.meta.url);
26+
const dirname = path.dirname(filename);
27+
const outputFile = path.normalize(
28+
path.join(dirname, '..', '..', 'amplify_outputs.json'),
29+
);
30+
31+
const outputs = JSON.parse(await readFile(outputFile, { encoding: 'utf8' }));
32+
2233
Amplify.configure(outputs);
2334

2435
const dataClient = generateClient<Schema>();

0 commit comments

Comments
 (0)