Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit e1d7350

Browse files
authored
test: enable numeric integration tests on emulator (#1358)
The emulator now supports the `NUMERIC` data type.
1 parent 6ed9079 commit e1d7350

1 file changed

Lines changed: 25 additions & 59 deletions

File tree

system-test/spanner.ts

Lines changed: 25 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -179,59 +179,31 @@ describe('Spanner', () => {
179179
}
180180

181181
before(done => {
182-
if (IS_EMULATOR_ENABLED) {
183-
// Table without NUMERIC types since the emulator doesn't yet support
184-
// this type.
185-
DATABASE.updateSchema(
186-
`
187-
CREATE TABLE ${TABLE_NAME} (
188-
Key STRING(MAX) NOT NULL,
189-
BytesValue BYTES(MAX),
190-
BoolValue BOOL,
191-
DateValue DATE,
192-
FloatValue FLOAT64,
193-
IntValue INT64,
194-
StringValue STRING(MAX),
195-
TimestampValue TIMESTAMP,
196-
BytesArray ARRAY<BYTES(MAX)>,
197-
BoolArray ARRAY<BOOL>,
198-
DateArray ARRAY<DATE>,
199-
FloatArray ARRAY<FLOAT64>,
200-
IntArray ARRAY<INT64>,
201-
StringArray ARRAY<STRING(MAX)>,
202-
TimestampArray ARRAY<TIMESTAMP>,
203-
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
204-
) PRIMARY KEY (Key)
205-
`,
206-
execAfterOperationComplete(done)
207-
);
208-
} else {
209-
DATABASE.updateSchema(
210-
`
211-
CREATE TABLE ${TABLE_NAME} (
212-
Key STRING(MAX) NOT NULL,
213-
BytesValue BYTES(MAX),
214-
BoolValue BOOL,
215-
DateValue DATE,
216-
FloatValue FLOAT64,
217-
IntValue INT64,
218-
NumericValue NUMERIC,
219-
StringValue STRING(MAX),
220-
TimestampValue TIMESTAMP,
221-
BytesArray ARRAY<BYTES(MAX)>,
222-
BoolArray ARRAY<BOOL>,
223-
DateArray ARRAY<DATE>,
224-
FloatArray ARRAY<FLOAT64>,
225-
IntArray ARRAY<INT64>,
226-
NumericArray ARRAY<NUMERIC>,
227-
StringArray ARRAY<STRING(MAX)>,
228-
TimestampArray ARRAY<TIMESTAMP>,
229-
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
230-
) PRIMARY KEY (Key)
231-
`,
232-
execAfterOperationComplete(done)
233-
);
234-
}
182+
DATABASE.updateSchema(
183+
`
184+
CREATE TABLE ${TABLE_NAME} (
185+
Key STRING(MAX) NOT NULL,
186+
BytesValue BYTES(MAX),
187+
BoolValue BOOL,
188+
DateValue DATE,
189+
FloatValue FLOAT64,
190+
IntValue INT64,
191+
NumericValue NUMERIC,
192+
StringValue STRING(MAX),
193+
TimestampValue TIMESTAMP,
194+
BytesArray ARRAY<BYTES(MAX)>,
195+
BoolArray ARRAY<BOOL>,
196+
DateArray ARRAY<DATE>,
197+
FloatArray ARRAY<FLOAT64>,
198+
IntArray ARRAY<INT64>,
199+
NumericArray ARRAY<NUMERIC>,
200+
StringArray ARRAY<STRING(MAX)>,
201+
TimestampArray ARRAY<TIMESTAMP>,
202+
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
203+
) PRIMARY KEY (Key)
204+
`,
205+
execAfterOperationComplete(done)
206+
);
235207
});
236208

237209
describe('uneven rows', () => {
@@ -558,12 +530,6 @@ describe('Spanner', () => {
558530
});
559531

560532
describe('numerics', () => {
561-
before(async function () {
562-
if (IS_EMULATOR_ENABLED) {
563-
this.skip();
564-
}
565-
});
566-
567533
it('should write numeric values', done => {
568534
const value = Spanner.numeric('3.141592653');
569535

0 commit comments

Comments
 (0)