Skip to content

Commit da3d96b

Browse files
committed
adjustments
1 parent e6de640 commit da3d96b

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

package-lock.json

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/src/commands/sandbox/sandbox-seed/sandbox_seed_command.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ void describe('sandbox seed command', () => {
4747
() => null,
4848
);
4949

50+
const mockProfileResolver = mock.fn();
51+
5052
let amplifySeedDir: string;
5153
let fullPath: string;
5254

@@ -57,6 +59,7 @@ void describe('sandbox seed command', () => {
5759
before(async () => {
5860
const sandboxFactory = new SandboxSingletonFactory(
5961
() => Promise.resolve(testBackendId),
62+
mockProfileResolver,
6063
printer,
6164
format,
6265
);
@@ -102,7 +105,6 @@ void describe('sandbox seed command', () => {
102105
}
103106
});
104107

105-
// this is deceptively hard to test because mocking open/read did not work on Linux/Mac
106108
void it('runs seed if seed script is found', async () => {
107109
const output = await commandRunner.runCommand('sandbox seed');
108110

@@ -135,7 +137,6 @@ void describe('sandbox seed command', () => {
135137
await assert.rejects(
136138
() => commandRunner.runCommand('sandbox seed'),
137139
(err: TestCommandError) => {
138-
// file differences between Unix and Windows makes it tricky to add the path
139140
assert.match(err.output, /SeedScriptNotFoundError/);
140141
assert.match(err.output, /There is no file that corresponds to/);
141142
assert.match(

packages/cli/src/commands/sandbox/sandbox-seed/sandbox_seed_command.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class SandboxSeedCommand implements CommandModule<object> {
3636
* @inheritDoc
3737
*/
3838
handler = async (): Promise<void> => {
39-
printer.startSpinner('runSeedSpinner', '');
39+
printer.startSpinner('');
4040
const backendID = await this.backendIDResolver.resolve();
4141
const seedPath = path.join('amplify', 'seed', 'seed.ts');
4242
try {
@@ -48,10 +48,10 @@ export class SandboxSeedCommand implements CommandModule<object> {
4848
},
4949
});
5050
} catch (err) {
51-
printer.stopSpinner('runSeedSpinner');
51+
printer.stopSpinner();
5252
throw err;
5353
}
54-
printer.stopSpinner('runSeedSpinner');
54+
printer.stopSpinner();
5555
printer.printNewLine();
5656
printer.print(`${format.success('✔')} seed has successfully completed`);
5757
};
@@ -63,7 +63,6 @@ export class SandboxSeedCommand implements CommandModule<object> {
6363
return yargs.command(this.seedSubCommands).check(() => {
6464
const seedPath = path.join(process.cwd(), 'amplify', 'seed', 'seed.ts');
6565
if (!existsSync(seedPath)) {
66-
// this only gets sent to outputs
6766
throw new AmplifyUserError('SeedScriptNotFoundError', {
6867
message: `There is no file that corresponds to ${seedPath}`,
6968
resolution: `Please make a file that corresponds to ${seedPath} and put your seed logic in it`,

packages/integration-tests/src/test-projects/data-storage-auth-with-triggers-ts/amplify/func-src/handler_node16.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import { Blob } from 'buffer';
77
global.fetch = fetch as never;
88
global.Blob = Blob as never;
99

10-
// node 16 does not include Blob, so we need to polyfill it
11-
import { Blob } from 'node-fetch';
12-
global.Blob = Blob as never;
13-
1410
/**
1511
* Dummy lambda handler to test building a function with a local import
1612
*/

packages/seed/src/auth-seed/auth_client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void describe('seeding auth APIs', () => {
143143
});
144144
});
145145

146-
// this is also where the tests that apply to all createAndSignUp user flows go
146+
// encompasses tests that apply to all createAndSignUpUser flows
147147
void describe('userpool configured without MFA', () => {
148148
const mockConfigReader = {
149149
getAuthConfig: mock.fn<() => Promise<AuthConfiguration>>(async () =>

0 commit comments

Comments
 (0)