diff --git a/test/behavesLikeMariaDbFormatter.ts b/test/behavesLikeMariaDbFormatter.ts index 9fe47ddd0e..873a99caf4 100644 --- a/test/behavesLikeMariaDbFormatter.ts +++ b/test/behavesLikeMariaDbFormatter.ts @@ -166,8 +166,7 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) { { keywordCase: 'upper' } ) ).toBe(dedent` - CREATE TABLE - account (id INT comment 'the most important column'); + CREATE TABLE account (id INT comment 'the most important column'); SELECT * diff --git a/test/bigquery.test.ts b/test/bigquery.test.ts index 2456953bcf..03309e060c 100644 --- a/test/bigquery.test.ts +++ b/test/bigquery.test.ts @@ -339,8 +339,7 @@ describe('BigQueryFormatter', () => { uris = ['gs://bucket/path1.csv'] )`; const expected = dedent` - CREATE EXTERNAL TABLE - dataset.CsvTable + CREATE EXTERNAL TABLE dataset.CsvTable WITH PARTITION COLUMNS (field_1 STRING, field_2 INT64) OPTIONS(format = 'CSV', uris = ['gs://bucket/path1.csv'])`; expect(format(input)).toBe(expected); diff --git a/test/features/constraints.ts b/test/features/constraints.ts index 4bda778842..52dc50a478 100644 --- a/test/features/constraints.ts +++ b/test/features/constraints.ts @@ -13,11 +13,10 @@ export default function supportsConstraints(format: FormatFn, actions: string[]) ); `) ).toBe(dedent` - CREATE TABLE - foo ( - update_time datetime ON UPDATE ${action}, - delete_time datetime ON DELETE ${action}, - ); + CREATE TABLE foo ( + update_time datetime ON UPDATE ${action}, + delete_time datetime ON DELETE ${action}, + ); `); }); }); diff --git a/test/features/createTable.ts b/test/features/createTable.ts index 508d9c1a86..b7e8fa64e2 100644 --- a/test/features/createTable.ts +++ b/test/features/createTable.ts @@ -15,8 +15,7 @@ export default function supportsCreateTable( ) { it('formats short CREATE TABLE', () => { expect(format('CREATE TABLE tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent` - CREATE TABLE - tbl (a INT PRIMARY KEY, b TEXT); + CREATE TABLE tbl (a INT PRIMARY KEY, b TEXT); `); }); @@ -26,21 +25,19 @@ export default function supportsCreateTable( expect( format('CREATE TABLE tbl (a INT PRIMARY KEY, b TEXT, c INT NOT NULL, doggie INT NOT NULL);') ).toBe(dedent` - CREATE TABLE - tbl ( - a INT PRIMARY KEY, - b TEXT, - c INT NOT NULL, - doggie INT NOT NULL - ); + CREATE TABLE tbl ( + a INT PRIMARY KEY, + b TEXT, + c INT NOT NULL, + doggie INT NOT NULL + ); `); }); if (orReplace) { it('formats short CREATE OR REPLACE TABLE', () => { expect(format('CREATE OR REPLACE TABLE tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent` - CREATE OR REPLACE TABLE - tbl (a INT PRIMARY KEY, b TEXT); + CREATE OR REPLACE TABLE tbl (a INT PRIMARY KEY, b TEXT); `); }); } @@ -48,8 +45,7 @@ export default function supportsCreateTable( if (ifNotExists) { it('formats short CREATE TABLE IF NOT EXISTS', () => { expect(format('CREATE TABLE IF NOT EXISTS tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent` - CREATE TABLE IF NOT EXISTS - tbl (a INT PRIMARY KEY, b TEXT); + CREATE TABLE IF NOT EXISTS tbl (a INT PRIMARY KEY, b TEXT); `); }); } @@ -59,11 +55,10 @@ export default function supportsCreateTable( expect( format(`CREATE TABLE tbl (a INT COMMENT 'Hello world!', b TEXT COMMENT 'Here we are!');`) ).toBe(dedent` - CREATE TABLE - tbl ( - a INT COMMENT 'Hello world!', - b TEXT COMMENT 'Here we are!' - ); + CREATE TABLE tbl ( + a INT COMMENT 'Hello world!', + b TEXT COMMENT 'Here we are!' + ); `); }); } @@ -71,8 +66,7 @@ export default function supportsCreateTable( if (tableComment) { it('formats short CREATE TABLE with comment', () => { expect(format(`CREATE TABLE tbl (a INT, b TEXT) COMMENT = 'Hello, world!';`)).toBe(dedent` - CREATE TABLE - tbl (a INT, b TEXT) COMMENT = 'Hello, world!'; + CREATE TABLE tbl (a INT, b TEXT) COMMENT = 'Hello, world!'; `); }); } diff --git a/test/features/createView.ts b/test/features/createView.ts index c368b7cb35..3d13ae80ba 100644 --- a/test/features/createView.ts +++ b/test/features/createView.ts @@ -61,8 +61,7 @@ export default function supportsCreateView( if (ifNotExists) { it('formats short CREATE TABLE IF NOT EXISTS', () => { expect(format('CREATE TABLE IF NOT EXISTS tbl (a INT PRIMARY KEY, b TEXT);')).toBe(dedent` - CREATE TABLE IF NOT EXISTS - tbl (a INT PRIMARY KEY, b TEXT); + CREATE TABLE IF NOT EXISTS tbl (a INT PRIMARY KEY, b TEXT); `); }); } diff --git a/test/postgresql.test.ts b/test/postgresql.test.ts index 607f376a97..534a57c259 100644 --- a/test/postgresql.test.ts +++ b/test/postgresql.test.ts @@ -222,13 +222,12 @@ describe('PostgreSqlFormatter', () => { deleted_at TIME WITH TIME ZONE, modified_at TIMESTAMP(0) WITH TIME ZONE);`) ).toBe(dedent` - CREATE TABLE - time_table ( - id INT, - created_at TIMESTAMP WITH TIME ZONE, - deleted_at TIME WITH TIME ZONE, - modified_at TIMESTAMP(0) WITH TIME ZONE - ); + CREATE TABLE time_table ( + id INT, + created_at TIMESTAMP WITH TIME ZONE, + deleted_at TIME WITH TIME ZONE, + modified_at TIMESTAMP(0) WITH TIME ZONE + ); `); }); diff --git a/test/redshift.test.ts b/test/redshift.test.ts index c44a1d0859..6292dc7b29 100644 --- a/test/redshift.test.ts +++ b/test/redshift.test.ts @@ -2,24 +2,23 @@ import dedent from 'dedent-js'; import { format as originalFormat, FormatFn } from '../src/sqlFormatter.js'; import behavesLikeSqlFormatter from './behavesLikeSqlFormatter.js'; - import supportsAlterTable from './features/alterTable.js'; +import supportsCommentOn from './features/commentOn.js'; +import supportsComments from './features/comments.js'; import supportsCreateTable from './features/createTable.js'; +import supportsCreateView from './features/createView.js'; +import supportsDeleteFrom from './features/deleteFrom.js'; import supportsDropTable from './features/dropTable.js'; +import supportsIdentifiers from './features/identifiers.js'; +import supportsInsertInto from './features/insertInto.js'; import supportsJoin from './features/join.js'; +import supportsLimiting from './features/limiting.js'; import supportsOperators from './features/operators.js'; -import supportsStrings from './features/strings.js'; -import supportsDeleteFrom from './features/deleteFrom.js'; -import supportsComments from './features/comments.js'; -import supportsCommentOn from './features/commentOn.js'; -import supportsIdentifiers from './features/identifiers.js'; -import supportsParams from './options/param.js'; import supportsSetOperations from './features/setOperations.js'; -import supportsLimiting from './features/limiting.js'; -import supportsInsertInto from './features/insertInto.js'; -import supportsUpdate from './features/update.js'; +import supportsStrings from './features/strings.js'; import supportsTruncateTable from './features/truncateTable.js'; -import supportsCreateView from './features/createView.js'; +import supportsUpdate from './features/update.js'; +import supportsParams from './options/param.js'; describe('RedshiftFormatter', () => { const language = 'redshift'; @@ -89,8 +88,7 @@ describe('RedshiftFormatter', () => { it('formats temp table name starting with #', () => { expect(format(`CREATE TABLE #tablename AS tbl;`)).toBe( dedent` - CREATE TABLE - #tablename AS tbl; + CREATE TABLE #tablename AS tbl; ` ); }); @@ -101,14 +99,13 @@ describe('RedshiftFormatter', () => { 'CREATE TABLE items (a INT PRIMARY KEY, b TEXT, c INT NOT NULL, d INT NOT NULL, e INT NOT NULL) DISTKEY(created_at) SORTKEY(created_at);' ) ).toBe(dedent` - CREATE TABLE - items ( - a INT PRIMARY KEY, - b TEXT, - c INT NOT NULL, - d INT NOT NULL, - e INT NOT NULL - ) DISTKEY (created_at) SORTKEY (created_at); + CREATE TABLE items ( + a INT PRIMARY KEY, + b TEXT, + c INT NOT NULL, + d INT NOT NULL, + e INT NOT NULL + ) DISTKEY (created_at) SORTKEY (created_at); `); }); diff --git a/test/snowflake.test.ts b/test/snowflake.test.ts index 561c91b406..ecff64b3a0 100644 --- a/test/snowflake.test.ts +++ b/test/snowflake.test.ts @@ -176,11 +176,10 @@ describe('SnowflakeFormatter', () => { } ) ).toBe(dedent` - CREATE TABLE - tbl ( - first_column DOUBLE PRECISION, - second_column NUMBER (38, 0), - third STRING - );`); + CREATE TABLE tbl ( + first_column DOUBLE PRECISION, + second_column NUMBER (38, 0), + third STRING + );`); }); });