Skip to content

Commit

Permalink
test(core): Fix failing e2e test
Browse files Browse the repository at this point in the history
* test(core): Fix custom fields e2e test
  • Loading branch information
michaelbromley authored Jan 29, 2020
1 parent 06043a5 commit 25a03e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 1 addition & 7 deletions e2e-common/test-config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { mergeConfig } from '@vendure/core';
import {
MysqlInitializer,
PostgresInitializer,
registerInitializer,
SqljsInitializer,
testConfig as defaultTestConfig,
} from '@vendure/testing';
import { MysqlInitializer, PostgresInitializer, registerInitializer, SqljsInitializer, testConfig as defaultTestConfig } from '@vendure/testing';
import path from 'path';
import { ConnectionOptions } from 'typeorm';

Expand Down
9 changes: 8 additions & 1 deletion packages/core/src/entity/register-custom-entity-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ function registerCustomFieldsForEntity(
}
options.length = length;
}
if (customField.type === 'datetime' && options.precision == null) {
if (
customField.type === 'datetime' &&
options.precision == null &&
// Setting precision on an sqlite datetime will cause
// spurious migration commands. See https://github.com/typeorm/typeorm/issues/2333
dbEngine !== 'sqljs' &&
dbEngine !== 'sqlite'
) {
options.precision = 6;
}
Column(options)(new ctor(), name);
Expand Down

0 comments on commit 25a03e6

Please sign in to comment.