Skip to content

Commit 2a6f775

Browse files
author
hirsch88
committed
Merge branch 'develop' into feature/seed
* develop: Have repo mock return promises to match typeorm more accurately. Fixes #67 Add config command in setup
2 parents e5748aa + c2d2912 commit 2a6f775

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test": "npm start test",
99
"build": "npm start build",
1010
"presetup": "yarn install",
11-
"setup": "npm start setup.db"
11+
"setup": "npm start config && npm start setup.script"
1212
},
1313
"engines": {
1414
"node": ">=8.0.0"

test/unit/lib/RepositoryMock.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ export class RepositoryMock<T> {
88
public saveMock = jest.fn();
99
public deleteMock = jest.fn();
1010

11-
public find(...args: any[]): T[] {
11+
public find(...args: any[]): Promise<T[]> {
1212
this.findMock(args);
13-
return this.list;
13+
return Promise.resolve(this.list);
1414
}
1515

16-
public findOne(...args: any[]): T {
16+
public findOne(...args: any[]): Promise<T> {
1717
this.findOneMock(args);
18-
return this.one;
18+
return Promise.resolve(this.one);
1919
}
2020

21-
public save(value: T, ...args: any[]): T {
21+
public save(value: T, ...args: any[]): Promise<T> {
2222
this.saveMock(value, args);
23-
return value;
23+
return Promise.resolve(value);
2424
}
2525

26-
public delete(value: T, ...args: any[]): T {
26+
public delete(value: T, ...args: any[]): Promise<T> {
2727
this.deleteMock(value, args);
28-
return value;
28+
return Promise.resolve(value);
2929
}
3030

3131
}

0 commit comments

Comments
 (0)