@postxl/generator 0.49.4 → 0.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,7 +47,7 @@ export class TestDataService {
|
|
|
47
47
|
) {}
|
|
48
48
|
|
|
49
49
|
public async resetTestData(data: MockData) {
|
|
50
|
-
await this.db.
|
|
50
|
+
await this.db.WIPE_ENTIRE_DATABASE()
|
|
51
51
|
|
|
52
52
|
// We need to init the user repository first so the root user is created
|
|
53
53
|
await this.dataService.users.init()
|
|
@@ -511,7 +511,7 @@ function generateMainBuildingBlocks_InDatabase({ model, meta, schemaMeta, import
|
|
|
511
511
|
public async reInit(
|
|
512
512
|
{ items, execution }: ${methodTypeSignatures.createMany.parameters[0]}
|
|
513
513
|
): Promise<void> {
|
|
514
|
-
if (!this.db.
|
|
514
|
+
if (!this.db.isTestDB) {
|
|
515
515
|
const errorMsg =
|
|
516
516
|
'ReInit() shall only be called in tests using MockRepositories or in DB configured for E2E tests!'
|
|
517
517
|
this.logger.error(errorMsg)
|
|
@@ -1130,7 +1130,7 @@ function generateDefaultBlocks({ model, meta }) {
|
|
|
1130
1130
|
this.defaultValue = item
|
|
1131
1131
|
}`,
|
|
1132
1132
|
checkCode: `
|
|
1133
|
-
if (!this.
|
|
1133
|
+
if (!this.defaultValue) {
|
|
1134
1134
|
throw new Error('No default ${meta.userFriendlyName} found!')
|
|
1135
1135
|
}`,
|
|
1136
1136
|
},
|