diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e119f79..5325f3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v3 diff --git a/package.json b/package.json index 58658e9..6466900 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "prepublishOnly": "yarn test && yarn build", "clean": "rm -rf dist", "build": "yarn clean && tsc", - "test": "jest" + "test": "yarn node --experimental-vm-modules $(yarn bin jest)", + "pretty": "prettier -w src/" }, "keywords": [ "prettier", @@ -29,14 +30,14 @@ "plugin" ], "dependencies": { - "prettier": "^2.8.2", + "prettier": "^3.0.3", "sql-parser-cst": "^0.17.1" }, "devDependencies": { "@types/jest": "^29.2.5", "dedent-js": "^1.0.1", - "jest": "^29.3.1", - "ts-jest": "^29.0.3", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", "typescript": "^4.9.4" } } diff --git a/src/CstToDocMap.ts b/src/CstToDocMap.ts index d2e5fde..8ec419a 100644 --- a/src/CstToDocMap.ts +++ b/src/CstToDocMap.ts @@ -9,7 +9,7 @@ export type ToDocFn = ( print: PrintFn, node: TNode, path: AstPath, - options: AllPrettierOptions + options: AllPrettierOptions, ) => Doc; export type CstToDocMap = { diff --git a/src/embedJs.ts b/src/embedJs.ts index 3d4e5cd..7ffcb3a 100644 --- a/src/embedJs.ts +++ b/src/embedJs.ts @@ -8,13 +8,8 @@ import { } from "./node_utils"; import { hardline, indent, stripTrailingHardline } from "./print_utils"; -export const embedJs: NonNullable["embed"]> = ( - path, - print, - textToDoc, - options -) => { - const node = path.getValue(); +export const embedJs: NonNullable["embed"]> = (path, options) => { + const node = path.getValue(); // TODO: Don't use deprecated method const parent = path.getParentNode(0); const grandParent = path.getParentNode(1); if ( @@ -23,30 +18,32 @@ export const embedJs: NonNullable["embed"]> = ( isCreateFunctionStmt(grandParent) && grandParent.clauses.some(isJavaScriptLanguageClause) ) { - const quotes = detectQuotes(node.value); - if (!quotes) { - // Give up for now. Don't format JavaScript inside the string. - // Perhaps tackle this corner-case in the future. - return null; - } + return async (textToDoc) => { + const quotes = detectQuotes(node.value); + if (!quotes) { + // Give up for now. Don't format JavaScript inside the string. + // Perhaps tackle this corner-case in the future. + return undefined; + } - const js = textToDoc(node.value, { - ...options, - parser: "babel", - }); + const js = await textToDoc(node.value, { + ...options, + parser: "babel", + }); - return [ - quotes[0], - indent([hardline, stripTrailingHardline(js)]), - hardline, - quotes[1], - ]; + return [ + quotes[0], + indent([hardline, stripTrailingHardline(js)]), + hardline, + quotes[1], + ]; + }; } return null; }; const isJavaScriptLanguageClause = ( - clause: CreateFunctionStmt["clauses"][0] + clause: CreateFunctionStmt["clauses"][0], ): boolean => isLanguageClause(clause) && clause.name.name === "js"; // Whether to quote the code with single- or double-quotes. diff --git a/src/embedJson.ts b/src/embedJson.ts index 85cdcfe..ae67c25 100644 --- a/src/embedJson.ts +++ b/src/embedJson.ts @@ -10,33 +10,33 @@ import { export const embedJson: NonNullable["embed"]> = ( path, - print, - textToDoc, - options + options, ) => { - const node = path.getValue(); + const node = path.getValue(); // TODO: Don't use deprecated method const parent = path.getParentNode(); if (isStringLiteral(node) && isJsonLiteral(parent)) { - if ( - containsTripleQuote(node.value) || - containsBackslash(node.value) || - isRawString(node) - ) { - // Give up for now. Don't format JSON inside the string. - // Tackle these corner-case in the future. - return null; - } - const json = textToDoc(node.value, { - ...options, - parser: "json", - }); - const inlineQuote = containsSingleQuote(node.value) ? "'''" : "'"; - return [ - ifBreak("'''", inlineQuote), - indent([softline, stripTrailingHardline(json)]), - softline, - ifBreak("'''", inlineQuote), - ]; + return async (textToDoc) => { + if ( + containsTripleQuote(node.value) || + containsBackslash(node.value) || + isRawString(node) + ) { + // Give up for now. Don't format JSON inside the string. + // Tackle these corner-case in the future. + return undefined; + } + const json = await textToDoc(node.value, { + ...options, + parser: "json", + }); + const inlineQuote = containsSingleQuote(node.value) ? "'''" : "'"; + return [ + ifBreak("'''", inlineQuote), + indent([softline, stripTrailingHardline(json)]), + softline, + ifBreak("'''", inlineQuote), + ]; + }; } return null; }; diff --git a/src/index.ts b/src/index.ts index 1c0eb0b..25e870c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ export const languages: SupportLanguage[] = [ ]; const createParser = (dialect: DialectName): Parser => ({ - parse: (text, parsers, options) => + parse: (text, options) => transformCst( parse(text, { dialect, @@ -32,7 +32,7 @@ const createParser = (dialect: DialectName): Parser => ({ filename: options.filepath, paramTypes: (options as AllPrettierOptions).sqlParamTypes, }), - text + text, ), astFormat: "sql-cst", locStart: (node) => node.range?.[0] as number, diff --git a/src/options.ts b/src/options.ts index cb5f815..269f326 100644 --- a/src/options.ts +++ b/src/options.ts @@ -13,25 +13,33 @@ export const options: SupportOptions = { sqlKeywordCase: { type: "choice", category: "SQL", - since: "0.1.0", default: "upper", description: "Enforces upper/lower case for SQL keywords", choices: [ { value: "preserve", description: "preserves the existing case", + since: "0.1.0", + }, + { + value: "upper", + description: "forces all keywords to uppercase", + since: "0.1.0", + }, + { + value: "lower", + description: "forces all keywords to lowercase", + since: "0.1.0", }, - { value: "upper", description: "forces all keywords to uppercase" }, - { value: "lower", description: "forces all keywords to lowercase" }, ], }, sqlParamTypes: { type: "string", array: true, category: "SQL", - since: "0.7.0", default: [{ value: [] }], description: "Syntax for bound parameters", + // Since 0.7.0 // Possible values in array: "?" | "?nr" | ":name" | "$name" | "@name" }, }; diff --git a/src/printSql.ts b/src/printSql.ts index fc4f4ed..a407065 100644 --- a/src/printSql.ts +++ b/src/printSql.ts @@ -10,7 +10,7 @@ import { join } from "./print_utils"; export function printSql( path: AstPath, options: AllPrettierOptions, - oldPrint: OldPrintFn + oldPrint: OldPrintFn, ): Doc { return printNode(path, options, createPrintFn(path, oldPrint)); } @@ -20,7 +20,7 @@ let cachedPath: AstPath; function createPrintFn( path: AstPath, - oldPrint: OldPrintFn + oldPrint: OldPrintFn, ): PrintFn { // The path parameter will reference the same AstPath instance // during the whole printing cycle. @@ -41,7 +41,7 @@ function createPrintFn( }) as PrintFn; cachedPrintFn.spaced = ( - selector: PrintableKey | PrintableKey[] + selector: PrintableKey | PrintableKey[], ): Doc[] => { const node = path.getValue(); const docs = arrayWrap(selector) @@ -60,7 +60,7 @@ function createPrintFn( function printNode( path: AstPath, options: AllPrettierOptions, - print: PrintFn + print: PrintFn, ): Doc { const node = path.getValue(); diff --git a/src/print_utils.ts b/src/print_utils.ts index 7a3bb5f..4992cfa 100644 --- a/src/print_utils.ts +++ b/src/print_utils.ts @@ -24,7 +24,7 @@ export const join = (sep: Doc, docs: Doc): Doc => /** True when the Node contains a newline in original source code */ export const containsNewline = ( node: Node, - opts: { originalText: string } + opts: { originalText: string }, ): boolean => { if (!node.range) { throw new Error("containsNewline() expected a Node with range info"); @@ -32,20 +32,20 @@ export const containsNewline = ( return util.hasNewlineInRange( opts.originalText, node.range[0], - node.range[1] + node.range[1], ); }; export const hasEmptyLineBetweenNodes = ( node1: Node, node2: Node, - opts: { originalText: string } + opts: { originalText: string }, ): boolean => { if (!node1.range || !node2.range) { throw new Error("emptyLineBetweenNodes() expects Nodes with range info"); } return /\n[ \t]*\r?\n/.test( - opts.originalText.slice(node1.range[1], node2.range[0]) + opts.originalText.slice(node1.range[1], node2.range[0]), ); }; diff --git a/src/syntax/constraint.ts b/src/syntax/constraint.ts index b6c4d04..905e018 100644 --- a/src/syntax/constraint.ts +++ b/src/syntax/constraint.ts @@ -51,7 +51,7 @@ export const constraintMap: Partial> = { const printUnnamedConstraint = ( print: PrintFn>, - node: Constraint + node: Constraint, ): Doc => { if (node.deferrable) { return group([ diff --git a/src/syntax/function.ts b/src/syntax/function.ts index 4069dd4..b4d8df0 100644 --- a/src/syntax/function.ts +++ b/src/syntax/function.ts @@ -21,7 +21,7 @@ export const functionMap: Partial> = { hardline, join( hardline, - print("clauses").map((cls) => group(cls)) + print("clauses").map((cls) => group(cls)), ), ], ], diff --git a/src/syntax/procedure.ts b/src/syntax/procedure.ts index fa78237..d6d497d 100644 --- a/src/syntax/procedure.ts +++ b/src/syntax/procedure.ts @@ -15,7 +15,7 @@ export const procedureMap: Partial> = { hardline, join( hardline, - print("clauses").map((clause) => group(clause)) + print("clauses").map((clause) => group(clause)), ), ], procedure_param: (print) => print.spaced(["mode", "name", "dataType"]), diff --git a/src/syntax/program.ts b/src/syntax/program.ts index 3fc7d11..dad483d 100644 --- a/src/syntax/program.ts +++ b/src/syntax/program.ts @@ -7,7 +7,7 @@ import { AllPrettierOptions } from "src/options"; export const programMap: CstToDocMap = { program: (print, node, path, options) => print("statements").map((doc, i) => - printStatement(doc, i, node.statements, options) + printStatement(doc, i, node.statements, options), ), }; @@ -15,7 +15,7 @@ const printStatement = ( doc: Doc, i: number, statements: Node[], - options: AllPrettierOptions + options: AllPrettierOptions, ): Doc => { const prevNode = statements[i - 1]; const node = statements[i]; diff --git a/src/syntax/select.ts b/src/syntax/select.ts index a15c987..2341a81 100644 --- a/src/syntax/select.ts +++ b/src/syntax/select.ts @@ -56,7 +56,7 @@ export const selectMap: Partial> = { ? indent([line, print(["specification"])]) : [], ], - ]) + ]), ), ]; } @@ -74,7 +74,7 @@ export const selectMap: Partial> = { group(print("aggregations")), print.spaced(["forKw", "inputColumn"]), print.spaced(["inKw", "pivotColumns"]), - ]) + ]), ), unpivot_expr: (print, node) => [ print("left"), @@ -91,7 +91,7 @@ export const selectMap: Partial> = { print("valuesColumn"), print.spaced(["forKw", "nameColumn"]), print.spaced(["inKw", "unpivotColumns"]), - ]) + ]), ), tablesample_expr: (print) => group([print("left"), line, print.spaced(["tablesampleKw", "args"])]), @@ -141,15 +141,15 @@ export const selectMap: Partial> = { return group( join( lineType, - print(["baseWindowName", "partitionBy", "orderBy", "frame"]) - ) + print(["baseWindowName", "partitionBy", "orderBy", "frame"]), + ), ); }, }; const printLimitValues = ( print: PrintFn, - node: LimitClause + node: LimitClause, ): Doc => { if (node.offsetKw) { return print.spaced(["count", "offsetKw", "offset"]); diff --git a/src/transform/addFinalSemicolon.ts b/src/transform/addFinalSemicolon.ts index 1e1fcc1..ec33d09 100644 --- a/src/transform/addFinalSemicolon.ts +++ b/src/transform/addFinalSemicolon.ts @@ -4,7 +4,7 @@ import { last } from "../utils"; export const addFinalSemicolon = ( program: Program, - originalText: string + originalText: string, ): Program => { if (!isEmpty(last(program.statements))) { const end = originalText.length; diff --git a/src/transform/comments.ts b/src/transform/comments.ts index 88ae068..01b8896 100644 --- a/src/transform/comments.ts +++ b/src/transform/comments.ts @@ -8,7 +8,7 @@ import { visitAllNodes } from "../visitAllNodes"; * Deletes the .leading and .trailing fields of all nodes. */ export const moveCommentsToRoot = ( - cst: Program + cst: Program, ): Program & { comments: Whitespace[] } => { return { ...cst, diff --git a/src/transform/transformCst.ts b/src/transform/transformCst.ts index 423c603..c483d94 100644 --- a/src/transform/transformCst.ts +++ b/src/transform/transformCst.ts @@ -9,5 +9,5 @@ import { addFinalSemicolon } from "./addFinalSemicolon"; export const transformCst = (cst: Program, originalText: string): Program => addFinalSemicolon( stripTrailingCommas(processAliasAs(moveCommentsToRoot(cst))), - originalText + originalText, ); diff --git a/test/alias.test.ts b/test/alias.test.ts index 35ca7e5..b9eddae 100644 --- a/test/alias.test.ts +++ b/test/alias.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { pretty, test } from "./test_utils"; describe("aliases", () => { - it(`formats aliases`, () => { - test( + it(`formats aliases`, async () => { + await test( dedent` SELECT 1 AS a, @@ -14,8 +14,8 @@ describe("aliases", () => { ); }); - it(`converts implicit aliases to use AS keyword`, () => { - expect(pretty(`SELECT 1 AS foo, 2 bar FROM client c, tbl AS t`)) + it(`converts implicit aliases to use AS keyword`, async () => { + expect(await pretty(`SELECT 1 AS foo, 2 bar FROM client c, tbl AS t`)) .toBe(dedent` SELECT 1 AS foo, 2 AS bar FROM diff --git a/test/analyze.test.ts b/test/analyze.test.ts index 849859d..0627100 100644 --- a/test/analyze.test.ts +++ b/test/analyze.test.ts @@ -1,11 +1,11 @@ import { test } from "./test_utils"; describe("analyze", () => { - it(`formats ANALYZE statement`, () => { - test(`ANALYZE my_schema.my_table`); + it(`formats ANALYZE statement`, async () => { + await test(`ANALYZE my_schema.my_table`); }); - it(`formats plain ANALYZE statement`, () => { - test(`ANALYZE`); + it(`formats plain ANALYZE statement`, async () => { + await test(`ANALYZE`); }); }); diff --git a/test/bigquery/bigquery.test.ts b/test/bigquery/bigquery.test.ts index 5620fab..5db9a04 100644 --- a/test/bigquery/bigquery.test.ts +++ b/test/bigquery/bigquery.test.ts @@ -3,24 +3,24 @@ import { testBigquery } from "../test_utils"; describe("bigquery", () => { ["CAPACITY", "RESERVATION", "ASSIGNMENT"].forEach((entityType) => { - it(`formats CREATE ${entityType}`, () => { - testBigquery(dedent` + it(`formats CREATE ${entityType}`, async () => { + await testBigquery(dedent` CREATE ${entityType} commitment_id OPTIONS (slot_count = 100, plan = 'FLEX') `); }); - it(`formats DROP ${entityType}`, () => { - testBigquery(`DROP ${entityType} commitment_id`); + it(`formats DROP ${entityType}`, async () => { + await testBigquery(`DROP ${entityType} commitment_id`); }); - it(`formats DROP ${entityType} IF EXISTS`, () => { - testBigquery(`DROP ${entityType} IF EXISTS commitment_id`); + it(`formats DROP ${entityType} IF EXISTS`, async () => { + await testBigquery(`DROP ${entityType} IF EXISTS commitment_id`); }); }); - it(`formats ALTER ORGANIZATION`, () => { - testBigquery(dedent` + it(`formats ALTER ORGANIZATION`, async () => { + await testBigquery(dedent` ALTER ORGANIZATION SET OPTIONS (default_time_zone = 'America/Los_Angeles') `); @@ -28,8 +28,8 @@ describe("bigquery", () => { ["PROJECT", "BI_CAPACITY", "CAPACITY", "RESERVATION"].forEach( (entityType) => { - it(`formats ALTER ${entityType}`, () => { - testBigquery(dedent` + it(`formats ALTER ${entityType}`, async () => { + await testBigquery(dedent` ALTER ${entityType} some_name SET OPTIONS (default_time_zone = 'America/Los_Angeles') `); @@ -38,14 +38,14 @@ describe("bigquery", () => { ); describe("assert", () => { - it(`formats ASSERT`, () => { - testBigquery(dedent` + it(`formats ASSERT`, async () => { + await testBigquery(dedent` ASSERT x > 10 `); }); - it(`formats ASSERT with message`, () => { - testBigquery(dedent` + it(`formats ASSERT with message`, async () => { + await testBigquery(dedent` ASSERT x > 10 AS 'x must be greater than 10' `); }); diff --git a/test/bigquery/export_and_load.test.ts b/test/bigquery/export_and_load.test.ts index 5fa6cf3..2f620f9 100644 --- a/test/bigquery/export_and_load.test.ts +++ b/test/bigquery/export_and_load.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("export & load", () => { - it(`formats EXPORT DATA`, () => { - testBigquery(dedent` + it(`formats EXPORT DATA`, async () => { + await testBigquery(dedent` EXPORT DATA OPTIONS (uri = 'gs://bucket/folder/*.csv', format = 'CSV') AS @@ -11,8 +11,8 @@ describe("export & load", () => { `); }); - it(`formats EXPORT DATA with CONNECTION`, () => { - testBigquery(dedent` + it(`formats EXPORT DATA with CONNECTION`, async () => { + await testBigquery(dedent` EXPORT DATA WITH CONNECTION myproject.us.myconnection OPTIONS (uri = 'gs://bucket/folder/*.csv', format = 'CSV') @@ -21,23 +21,23 @@ describe("export & load", () => { `); }); - it(`formats LOAD DATA`, () => { - testBigquery(dedent` + it(`formats LOAD DATA`, async () => { + await testBigquery(dedent` LOAD DATA INTO mydataset.table1 FROM FILES (format = 'AVRO', uris = ['gs://bucket/path/file.avro']) `); }); - it(`formats LOAD DATA with columns`, () => { - testBigquery(dedent` + it(`formats LOAD DATA with columns`, async () => { + await testBigquery(dedent` LOAD DATA INTO mydataset.table1 (x INT64, y STRING) OPTIONS (description = "my table") FROM FILES (format = 'AVRO', uris = ['gs://bucket/path/file.avro']) `); }); - it(`formats LOAD DATA with long column list`, () => { - testBigquery(dedent` + it(`formats LOAD DATA with long column list`, async () => { + await testBigquery(dedent` LOAD DATA INTO mydataset.table1 ( first_field INT64, second_field STRING, @@ -48,8 +48,8 @@ describe("export & load", () => { `); }); - it(`formats LOAD DATA with PARTITION/CLUSTER BY & WITH PARTITION COLUMNS & CONNECTION`, () => { - testBigquery(dedent` + it(`formats LOAD DATA with PARTITION/CLUSTER BY & WITH PARTITION COLUMNS & CONNECTION`, async () => { + await testBigquery(dedent` LOAD DATA INTO mydataset.table1 PARTITION BY transaction_date CLUSTER BY customer_id diff --git a/test/bigquery/row_access_policy.test.ts b/test/bigquery/row_access_policy.test.ts index a6f7174..5dcf428 100644 --- a/test/bigquery/row_access_policy.test.ts +++ b/test/bigquery/row_access_policy.test.ts @@ -3,22 +3,22 @@ import { testBigquery } from "../test_utils"; describe("row access policy", () => { describe("create row access policy", () => { - it(`formats CREATE ROW ACCESS POLICY`, () => { - testBigquery(dedent` + it(`formats CREATE ROW ACCESS POLICY`, async () => { + await testBigquery(dedent` CREATE ROW ACCESS POLICY policy_name ON my_table FILTER USING (x > 10) `); }); - it(`formats OR REPLACE / IF NOT EXISTS`, () => { - testBigquery(dedent` + it(`formats OR REPLACE / IF NOT EXISTS`, async () => { + await testBigquery(dedent` CREATE OR REPLACE ROW ACCESS POLICY IF NOT EXISTS policy_name ON my_table FILTER USING (x > 10) `); }); - it(`formats GRANT TO`, () => { - testBigquery(dedent` + it(`formats GRANT TO`, async () => { + await testBigquery(dedent` CREATE ROW ACCESS POLICY policy_name ON my_table GRANT TO ('user:alice@example.com', 'domain:example.com') FILTER USING (x > 10) @@ -27,20 +27,20 @@ describe("row access policy", () => { }); describe("drop row access policy", () => { - it(`formats DROP ROW ACCESS POLICY`, () => { - testBigquery(dedent` + it(`formats DROP ROW ACCESS POLICY`, async () => { + await testBigquery(dedent` DROP ROW ACCESS POLICY policy_name ON my_table `); }); - it(`formats IF EXISTS`, () => { - testBigquery(dedent` + it(`formats IF EXISTS`, async () => { + await testBigquery(dedent` DROP ROW ACCESS POLICY IF EXISTS policy_name ON my_table `); }); - it(`formats DROP ALL ROW ACCESS POLICIES`, () => { - testBigquery(dedent` + it(`formats DROP ALL ROW ACCESS POLICIES`, async () => { + await testBigquery(dedent` DROP ALL ROW ACCESS POLICIES ON my_table `); }); diff --git a/test/comments.test.ts b/test/comments.test.ts index 749f90a..6b169da 100644 --- a/test/comments.test.ts +++ b/test/comments.test.ts @@ -2,7 +2,7 @@ import dedent from "dedent-js"; import { rawPretty, rawTest } from "./test_utils"; describe("comments", () => { - it(`formats block comments`, () => { + it(`formats block comments`, async () => { rawTest(dedent` /* leading comment */ SELECT 1, /*com1*/ 2 /*com2*/; @@ -11,7 +11,7 @@ describe("comments", () => { `); }); - it(`formats basic doc-comments`, () => { + it(`formats basic doc-comments`, async () => { rawTest(dedent` /** * A large doc-comment comment @@ -22,7 +22,7 @@ describe("comments", () => { `); }); - it(`formats block comments between syntax elements`, () => { + it(`formats block comments between syntax elements`, async () => { rawTest(dedent` CREATE /*c1*/ TABLE /*c2*/ IF /*c3*/ NOT EXISTS /*c4*/ foo ( id /*c5*/ INT /*c6*/ NOT /*c7*/ NULL @@ -31,7 +31,7 @@ describe("comments", () => { `); }); - it(`formats line comments`, () => { + it(`formats line comments`, async () => { rawTest(dedent` -- first line comment -- second line comment @@ -41,9 +41,9 @@ describe("comments", () => { `); }); - it(`moves line comments before comma to line ends`, () => { + it(`moves line comments before comma to line ends`, async () => { expect( - rawPretty(` + await rawPretty(` SELECT 1 -- com1 ,2 -- com2 @@ -58,7 +58,7 @@ describe("comments", () => { `); }); - it(`formats comments between statements`, () => { + it(`formats comments between statements`, async () => { rawTest(dedent` -- comment for 1 SELECT 1; @@ -71,9 +71,9 @@ describe("comments", () => { `); }); - it(`enforces space between -- and comment text`, () => { + it(`enforces space between -- and comment text`, async () => { expect( - rawPretty(` + await rawPretty(` --My comment SELECT 1; `) @@ -84,9 +84,9 @@ describe("comments", () => { `); }); - it(`enforces space between # and comment text`, () => { + it(`enforces space between # and comment text`, async () => { expect( - rawPretty(` + await rawPretty(` #My comment SELECT 1; `) @@ -97,7 +97,7 @@ describe("comments", () => { `); }); - it(`allows for empty -- comments`, () => { + it(`allows for empty -- comments`, async () => { rawTest(dedent` -- -- @@ -106,7 +106,7 @@ describe("comments", () => { `); }); - it(`allows for empty # comments`, () => { + it(`allows for empty # comments`, async () => { rawTest(dedent` # # @@ -115,7 +115,7 @@ describe("comments", () => { `); }); - it(`preserves #! comments as-is`, () => { + it(`preserves #! comments as-is`, async () => { rawTest(dedent` #!/usr/bin/sqlite SELECT 1; @@ -124,7 +124,7 @@ describe("comments", () => { }); // Issue #9 - it.skip(`keeps separate-line line-comments on a separate line (not moving them to line end)`, () => { + it.skip(`keeps separate-line line-comments on a separate line (not moving them to line end)`, async () => { rawTest(dedent` CREATE TABLE foo -- com1 diff --git a/test/dcl/grant.test.ts b/test/dcl/grant.test.ts index e3cd270..360a3ad 100644 --- a/test/dcl/grant.test.ts +++ b/test/dcl/grant.test.ts @@ -2,24 +2,24 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("grant", () => { - it(`formats GRANT (single role, single user)`, () => { - testBigquery(dedent` + it(`formats GRANT (single role, single user)`, async () => { + await testBigquery(dedent` GRANT \`roles/bigquery.dataViewer\` ON TABLE myCompany.revenue TO 'user:tom@example.com' `); }); - it(`formats GRANT (multiple roles, multiple users)`, () => { - testBigquery(dedent` + it(`formats GRANT (multiple roles, multiple users)`, async () => { + await testBigquery(dedent` GRANT \`roles/bigquery.dataViewer\`, \`roles/bigquery.admin\` ON SCHEMA myCompany TO 'user:tom@example.com', 'user:sara@example.com' `); }); - it(`formats GRANT (multiline list of roles and users)`, () => { - testBigquery(dedent` + it(`formats GRANT (multiline list of roles and users)`, async () => { + await testBigquery(dedent` GRANT \`roles/bigquery.dataViewer\`, \`roles/bigquery.admin\`, diff --git a/test/dcl/revoke.test.ts b/test/dcl/revoke.test.ts index 206c980..d5542df 100644 --- a/test/dcl/revoke.test.ts +++ b/test/dcl/revoke.test.ts @@ -2,24 +2,24 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("revoke", () => { - it(`formats REVOKE (single role, single user)`, () => { - testBigquery(dedent` + it(`formats REVOKE (single role, single user)`, async () => { + await testBigquery(dedent` REVOKE \`roles/bigquery.dataViewer\` ON VIEW myCompany.revenue FROM 'user:tom@example.com' `); }); - it(`formats REVOKE (multiple roles, multiple users)`, () => { - testBigquery(dedent` + it(`formats REVOKE (multiple roles, multiple users)`, async () => { + await testBigquery(dedent` REVOKE \`roles/bigquery.dataViewer\`, \`roles/bigquery.admin\` ON SCHEMA myCompany FROM 'user:tom@example.com', 'user:sara@example.com' `); }); - it(`formats REVOKE (multiline list of roles and users)`, () => { - testBigquery(dedent` + it(`formats REVOKE (multiline list of roles and users)`, async () => { + await testBigquery(dedent` REVOKE \`roles/bigquery.dataViewer\`, \`roles/bigquery.admin\`, diff --git a/test/ddl/alter_table.test.ts b/test/ddl/alter_table.test.ts index 7debcef..80abd34 100644 --- a/test/ddl/alter_table.test.ts +++ b/test/ddl/alter_table.test.ts @@ -2,123 +2,123 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("alter table", () => { - it(`formats ALTER TABLE..RENAME`, () => { - test(dedent` + it(`formats ALTER TABLE..RENAME`, async () => { + await test(dedent` ALTER TABLE client RENAME TO org_client `); }); - it(`formats ALTER TABLE IF EXISTS`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE IF EXISTS`, async () => { + await testBigquery(dedent` ALTER TABLE IF EXISTS client RENAME TO org_client `); }); - it(`formats ALTER TABLE..RENAME COLUMN`, () => { - test(dedent` + it(`formats ALTER TABLE..RENAME COLUMN`, async () => { + await test(dedent` ALTER TABLE client RENAME col1 TO col2 `); - test(dedent` + await test(dedent` ALTER TABLE client RENAME COLUMN col1 TO col2 `); }); - it(`formats ALTER TABLE..RENAME COLUMN IF EXISTS`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE..RENAME COLUMN IF EXISTS`, async () => { + await testBigquery(dedent` ALTER TABLE client RENAME COLUMN IF EXISTS col1 TO col2 `); }); - it(`formats ALTER TABLE..ADD COLUMN`, () => { - test(dedent` + it(`formats ALTER TABLE..ADD COLUMN`, async () => { + await test(dedent` ALTER TABLE client ADD col1 INT `); - test(dedent` + await test(dedent` ALTER TABLE client ADD COLUMN col1 INT `); }); - it(`formats ALTER TABLE..ADD COLUMN IF NOT EXISTS`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE..ADD COLUMN IF NOT EXISTS`, async () => { + await testBigquery(dedent` ALTER TABLE client ADD COLUMN IF NOT EXISTS col1 INT `); }); - it(`formats ALTER TABLE..DROP COLUMN`, () => { - test(dedent` + it(`formats ALTER TABLE..DROP COLUMN`, async () => { + await test(dedent` ALTER TABLE client DROP col1 `); - test(dedent` + await test(dedent` ALTER TABLE client DROP COLUMN col1 `); }); - it(`formats ALTER TABLE..DROP COLUMN IF EXISTS`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE..DROP COLUMN IF EXISTS`, async () => { + await testBigquery(dedent` ALTER TABLE client DROP COLUMN IF EXISTS col1 `); }); - it(`formats ALTER TABLE..SET OPTIONS`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE..SET OPTIONS`, async () => { + await testBigquery(dedent` ALTER TABLE client SET OPTIONS (description = 'Table that expires seven days from now') `); }); - it(`formats ALTER TABLE..SET DEFAULT COLLATE`, () => { - testBigquery(dedent` + it(`formats ALTER TABLE..SET DEFAULT COLLATE`, async () => { + await testBigquery(dedent` ALTER TABLE client SET DEFAULT COLLATE 'und:ci' `); }); describe("alter column", () => { - it(`formats ALTER COLUMN .. SET OPTIONS`, () => { - testBigquery(dedent` + it(`formats ALTER COLUMN .. SET OPTIONS`, async () => { + await testBigquery(dedent` ALTER TABLE client ALTER COLUMN price SET OPTIONS (description = 'Price per unit') `); }); - it(`formats ALTER COLUMN [IF EXISTS] .. SET DEFAULT`, () => { - testBigquery(dedent` + it(`formats ALTER COLUMN [IF EXISTS] .. SET DEFAULT`, async () => { + await testBigquery(dedent` ALTER TABLE client ALTER COLUMN IF EXISTS price SET DEFAULT 100 `); }); - it(`formats ALTER COLUMN .. DROP DEFAULT`, () => { - testBigquery(dedent` + it(`formats ALTER COLUMN .. DROP DEFAULT`, async () => { + await testBigquery(dedent` ALTER TABLE client ALTER COLUMN price DROP DEFAULT `); }); - it(`formats ALTER COLUMN .. DROP NOT NULL`, () => { - testBigquery(dedent` + it(`formats ALTER COLUMN .. DROP NOT NULL`, async () => { + await testBigquery(dedent` ALTER TABLE client ALTER COLUMN price DROP NOT NULL `); }); - it(`formats ALTER COLUMN .. SET DATA TYPE`, () => { - testBigquery(dedent` + it(`formats ALTER COLUMN .. SET DATA TYPE`, async () => { + await testBigquery(dedent` ALTER TABLE client ALTER COLUMN price SET DATA TYPE INT64 diff --git a/test/ddl/create_table.test.ts b/test/ddl/create_table.test.ts index 30fca5e..b600e1d 100644 --- a/test/ddl/create_table.test.ts +++ b/test/ddl/create_table.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("create table", () => { - it(`formats CREATE TABLE always on multiple lines`, () => { - test(dedent` + it(`formats CREATE TABLE always on multiple lines`, async () => { + await test(dedent` CREATE TABLE client ( id INT, name VARCHAR(100), @@ -12,32 +12,32 @@ describe("create table", () => { `); }); - it(`formats CREATE TEMPORARY TABLE`, () => { - test(dedent` + it(`formats CREATE TEMPORARY TABLE`, async () => { + await test(dedent` CREATE TEMPORARY TABLE foo ( id INT ) `); }); - it(`formats IF NOT EXISTS`, () => { - test(dedent` + it(`formats IF NOT EXISTS`, async () => { + await test(dedent` CREATE TABLE IF NOT EXISTS foo ( id INT ) `); }); - it(`formats OR REPLACE`, () => { - testBigquery(dedent` + it(`formats OR REPLACE`, async () => { + await testBigquery(dedent` CREATE OR REPLACE TABLE foo ( id INT ) `); }); - it(`formats CREATE TABLE with various data types`, () => { - test(dedent` + it(`formats CREATE TABLE with various data types`, async () => { + await test(dedent` CREATE TABLE client ( id INTEGER, name VARCHAR(100), @@ -48,8 +48,8 @@ describe("create table", () => { `); }); - it(`formats CREATE TABLE with column constraints`, () => { - test(dedent` + it(`formats CREATE TABLE with column constraints`, async () => { + await test(dedent` CREATE TABLE client ( id INT NOT NULL PRIMARY KEY, name VARCHAR(100) UNIQUE COLLATE RTRIM, @@ -61,16 +61,16 @@ describe("create table", () => { `); }); - it(`formats SQLite PRIMARY KEY modifiers`, () => { - test(dedent` + it(`formats SQLite PRIMARY KEY modifiers`, async () => { + await test(dedent` CREATE TABLE client ( id INTEGER PRIMARY KEY ASC AUTOINCREMENT ) `); }); - it(`formats CREATE TABLE with table constraints`, () => { - test(dedent` + it(`formats CREATE TABLE with table constraints`, async () => { + await test(dedent` CREATE TABLE client ( id INT, name VARCHAR, @@ -82,8 +82,8 @@ describe("create table", () => { `); }); - it(`formats FOREIGN KEY constraint with options`, () => { - test(dedent` + it(`formats FOREIGN KEY constraint with options`, async () => { + await test(dedent` CREATE TABLE client ( id INT, FOREIGN KEY (org_id1) REFERENCES organization (id1) @@ -95,8 +95,8 @@ describe("create table", () => { `); }); - it(`formats deferrable FOREIGN KEY constraint`, () => { - test(dedent` + it(`formats deferrable FOREIGN KEY constraint`, async () => { + await test(dedent` CREATE TABLE client ( id INT, CONSTRAINT fkey @@ -108,16 +108,16 @@ describe("create table", () => { `); }); - it(`formats CREATE TABLE with named column constraints`, () => { - test(dedent` + it(`formats CREATE TABLE with named column constraints`, async () => { + await test(dedent` CREATE TABLE client ( id INT CONSTRAINT NOT NULL CONSTRAINT prim_key PRIMARY KEY ) `); }); - it(`formats CREATE TABLE with named table constraints`, () => { - test(dedent` + it(`formats CREATE TABLE with named table constraints`, async () => { + await test(dedent` CREATE TABLE client ( id INT, CONSTRAINT prim_key PRIMARY KEY (id, name), @@ -127,8 +127,8 @@ describe("create table", () => { `); }); - it(`formats constraints with ON CONFLICT clause`, () => { - test(dedent` + it(`formats constraints with ON CONFLICT clause`, async () => { + await test(dedent` CREATE TABLE client ( id INT, name VARCHAR(100) NOT NULL ON CONFLICT FAIL, @@ -138,8 +138,8 @@ describe("create table", () => { `); }); - it(`formats BigQuery data types with internal constraints`, () => { - testBigquery(dedent` + it(`formats BigQuery data types with internal constraints`, async () => { + await testBigquery(dedent` CREATE TABLE client ( arr_field ARRAY, struct_field STRUCT, @@ -149,8 +149,8 @@ describe("create table", () => { }); // Issue #10 - it(`formats long BigQuery struct definition to multiple lines`, () => { - testBigquery(dedent` + it(`formats long BigQuery struct definition to multiple lines`, async () => { + await testBigquery(dedent` CREATE TABLE client ( struct_field STRUCT< first_name STRING, @@ -163,8 +163,8 @@ describe("create table", () => { `); }); - it(`formats SQLite table options`, () => { - test(dedent` + it(`formats SQLite table options`, async () => { + await test(dedent` CREATE TABLE foo ( id INT ) @@ -172,8 +172,8 @@ describe("create table", () => { `); }); - it(`formats single short BigQuery extra CREATE TABLE clause`, () => { - testBigquery(dedent` + it(`formats single short BigQuery extra CREATE TABLE clause`, async () => { + await testBigquery(dedent` CREATE TABLE client ( id INT64 ) @@ -181,8 +181,8 @@ describe("create table", () => { `); }); - it(`formats additional BigQuery CREATE TABLE clauses`, () => { - testBigquery(dedent` + it(`formats additional BigQuery CREATE TABLE clauses`, async () => { + await testBigquery(dedent` CREATE TABLE client ( id INT64 ) @@ -193,8 +193,8 @@ describe("create table", () => { `); }); - it(`formats long BigQuery OPTIONS ()`, () => { - testBigquery(dedent` + it(`formats long BigQuery OPTIONS ()`, async () => { + await testBigquery(dedent` CREATE TABLE client ( id INT64 ) @@ -207,15 +207,15 @@ describe("create table", () => { `); }); - it(`formats CREATE TABLE AS`, () => { - test(dedent` + it(`formats CREATE TABLE AS`, async () => { + await test(dedent` CREATE TABLE foo AS SELECT * FROM tbl WHERE x > 0 `); }); - it(`formats CREATE TABLE AS with long query`, () => { - test(dedent` + it(`formats CREATE TABLE AS with long query`, async () => { + await test(dedent` CREATE TABLE foo AS SELECT column1, column2, column3 FROM external_client @@ -223,36 +223,36 @@ describe("create table", () => { `); }); - it(`formats CREATE TABLE LIKE`, () => { - testBigquery(dedent` + it(`formats CREATE TABLE LIKE`, async () => { + await testBigquery(dedent` CREATE TABLE foo LIKE my_old_table `); }); - it(`formats CREATE TABLE COPY`, () => { - testBigquery(dedent` + it(`formats CREATE TABLE COPY`, async () => { + await testBigquery(dedent` CREATE TABLE foo COPY my_old_table `); }); - it(`formats CREATE SNAPSHOT TABLE CLONE`, () => { - testBigquery(dedent` + it(`formats CREATE SNAPSHOT TABLE CLONE`, async () => { + await testBigquery(dedent` CREATE SNAPSHOT TABLE foo CLONE my_old_table `); }); - it(`formats FOR SYSTEM_TIME AS OF`, () => { - testBigquery(dedent` + it(`formats FOR SYSTEM_TIME AS OF`, async () => { + await testBigquery(dedent` CREATE SNAPSHOT TABLE foo CLONE my_old_table FOR SYSTEM_TIME AS OF '2017-01-01 10:00:00-07:00' `); }); - it(`formats CREATE EXTERNAL TABLE`, () => { - testBigquery(dedent` + it(`formats CREATE EXTERNAL TABLE`, async () => { + await testBigquery(dedent` CREATE EXTERNAL TABLE dataset.CustomTable ( id INT64 ) @@ -262,8 +262,8 @@ describe("create table", () => { `); }); - it(`formats CREATE EXTERNAL TABLE with long PARTITION COLUMNS list`, () => { - testBigquery(dedent` + it(`formats CREATE EXTERNAL TABLE with long PARTITION COLUMNS list`, async () => { + await testBigquery(dedent` CREATE EXTERNAL TABLE dataset.CustomTable WITH PARTITION COLUMNS ( first_name STRING, @@ -274,8 +274,8 @@ describe("create table", () => { `); }); - it(`formats CREATE VIRTUAL TABLE`, () => { - test(dedent` + it(`formats CREATE VIRTUAL TABLE`, async () => { + await test(dedent` CREATE VIRTUAL TABLE my_table USING my_func(1, 2) `); diff --git a/test/ddl/drop_table.test.ts b/test/ddl/drop_table.test.ts index bb3bef4..9142367 100644 --- a/test/ddl/drop_table.test.ts +++ b/test/ddl/drop_table.test.ts @@ -1,19 +1,19 @@ import { test, testBigquery } from "../test_utils"; describe("drop table", () => { - it(`formats DROP TABLE statement`, () => { - test(`DROP TABLE client`); + it(`formats DROP TABLE statement`, async () => { + await test(`DROP TABLE client`); }); - it(`formats IF EXISTS`, () => { - test(`DROP TABLE IF EXISTS schm.client`); + it(`formats IF EXISTS`, async () => { + await test(`DROP TABLE IF EXISTS schm.client`); }); - it(`formats DROP SNAPSHOT table`, () => { - testBigquery(`DROP SNAPSHOT TABLE foo`); + it(`formats DROP SNAPSHOT table`, async () => { + await testBigquery(`DROP SNAPSHOT TABLE foo`); }); - it(`formats DROP EXTERNAL table`, () => { - testBigquery(`DROP EXTERNAL TABLE foo`); + it(`formats DROP EXTERNAL table`, async () => { + await testBigquery(`DROP EXTERNAL TABLE foo`); }); }); diff --git a/test/ddl/function.test.ts b/test/ddl/function.test.ts index 1d28487..df25381 100644 --- a/test/ddl/function.test.ts +++ b/test/ddl/function.test.ts @@ -3,15 +3,15 @@ import { pretty, testBigquery } from "../test_utils"; describe("function", () => { describe("create function", () => { - it(`formats CREATE FUNCTION`, () => { - testBigquery(dedent` + it(`formats CREATE FUNCTION`, async () => { + await testBigquery(dedent` CREATE FUNCTION my_func(arg1 INT64, arg2 STRING, arg3 ANY TYPE) AS (SELECT * FROM client) `); }); - it(`formats long parameter list to multiple lines`, () => { - testBigquery(dedent` + it(`formats long parameter list to multiple lines`, async () => { + await testBigquery(dedent` CREATE FUNCTION my_func( first_name STRING, last_name STRING, @@ -21,29 +21,29 @@ describe("function", () => { `); }); - it(`formats CREATE TEMP FUNCTION`, () => { - testBigquery(dedent` + it(`formats CREATE TEMP FUNCTION`, async () => { + await testBigquery(dedent` CREATE TEMPORARY FUNCTION my_func() AS (SELECT 1) `); }); - it(`formats OR REPLACE`, () => { - testBigquery(dedent` + it(`formats OR REPLACE`, async () => { + await testBigquery(dedent` CREATE OR REPLACE FUNCTION my_func() AS (SELECT 1) `); }); - it(`formats IF NOT EXISTS`, () => { - testBigquery(dedent` + it(`formats IF NOT EXISTS`, async () => { + await testBigquery(dedent` CREATE FUNCTION IF NOT EXISTS my_func() AS (SELECT 1) `); }); - it(`formats RETURNS clause`, () => { - testBigquery(dedent` + it(`formats RETURNS clause`, async () => { + await testBigquery(dedent` CREATE FUNCTION IF NOT EXISTS my_func() RETURNS INT64 AS @@ -51,8 +51,8 @@ describe("function", () => { `); }); - it(`formats OPTIONS (...)`, () => { - testBigquery(dedent` + it(`formats OPTIONS (...)`, async () => { + await testBigquery(dedent` CREATE FUNCTION IF NOT EXISTS my_func() AS (SELECT 1) @@ -60,8 +60,8 @@ describe("function", () => { `); }); - it(`formats CREATE TABLE FUNCTION`, () => { - testBigquery(dedent` + it(`formats CREATE TABLE FUNCTION`, async () => { + await testBigquery(dedent` CREATE TABLE FUNCTION my_func() RETURNS TABLE AS @@ -69,8 +69,8 @@ describe("function", () => { `); }); - it(`formats creation of remote function`, () => { - testBigquery(dedent` + it(`formats creation of remote function`, async () => { + await testBigquery(dedent` CREATE FUNCTION my_func() RETURNS INT64 REMOTE WITH CONNECTION us.myconnection @@ -78,8 +78,8 @@ describe("function", () => { `); }); - it(`formats JavaScript FUNCTION`, () => { - testBigquery(dedent` + it(`formats JavaScript FUNCTION`, async () => { + await testBigquery(dedent` CREATE FUNCTION gen_random() RETURNS FLOAT64 NOT DETERMINISTIC @@ -90,9 +90,9 @@ describe("function", () => { `); }); - it(`reformats JavaScript in JS function`, () => { + it(`reformats JavaScript in JS function`, async () => { expect( - pretty( + await pretty( dedent` CREATE FUNCTION gen_random() RETURNS FLOAT64 @@ -113,9 +113,9 @@ describe("function", () => { `); }); - it(`quotes JavaScript in double-quotes when single-quotes can't be used`, () => { + it(`quotes JavaScript in double-quotes when single-quotes can't be used`, async () => { expect( - pretty( + await pretty( dedent` CREATE FUNCTION contains_quotes(x STRING) RETURNS FLOAT64 @@ -134,9 +134,9 @@ describe("function", () => { `); }); - it(`does not reformat JavaScript when neither ''' or """ can be easily used for quoting`, () => { + it(`does not reformat JavaScript when neither ''' or """ can be easily used for quoting`, async () => { expect( - pretty( + await pretty( dedent` CREATE FUNCTION contains_quotes(x STRING) RETURNS FLOAT64 @@ -155,14 +155,14 @@ describe("function", () => { }); describe("drop function", () => { - it(`formats DROP FUNCTION`, () => { - testBigquery(`DROP FUNCTION my_schema.my_func`); + it(`formats DROP FUNCTION`, async () => { + await testBigquery(`DROP FUNCTION my_schema.my_func`); }); - it(`formats DROP TABLE FUNCTION`, () => { - testBigquery(`DROP TABLE FUNCTION my_func`); + it(`formats DROP TABLE FUNCTION`, async () => { + await testBigquery(`DROP TABLE FUNCTION my_func`); }); - it(`formats IF EXISTS`, () => { - testBigquery(`DROP FUNCTION IF EXISTS my_func`); + it(`formats IF EXISTS`, async () => { + await testBigquery(`DROP FUNCTION IF EXISTS my_func`); }); }); }); diff --git a/test/ddl/index.test.ts b/test/ddl/index.test.ts index 1f1de0d..28ba89b 100644 --- a/test/ddl/index.test.ts +++ b/test/ddl/index.test.ts @@ -3,26 +3,26 @@ import { test, testBigquery } from "../test_utils"; describe("index", () => { describe("create index", () => { - it(`formats CREATE INDEX`, () => { - test(dedent` + it(`formats CREATE INDEX`, async () => { + await test(dedent` CREATE INDEX my_index ON my_table (col1, col2) `); }); - it(`formats CREATE UNIQUE INDEX`, () => { - test(dedent` + it(`formats CREATE UNIQUE INDEX`, async () => { + await test(dedent` CREATE UNIQUE INDEX my_index ON my_table (col) `); }); - it(`formats IF NOT EXISTS`, () => { - test(dedent` + it(`formats IF NOT EXISTS`, async () => { + await test(dedent` CREATE INDEX IF NOT EXISTS my_index ON my_table (col) `); }); - it(`formats long columns list on multiple lines`, () => { - test(dedent` + it(`formats long columns list on multiple lines`, async () => { + await test(dedent` CREATE UNIQUE INDEX IF NOT EXISTS my_index ON my_table ( column_name_one, column_name_two, @@ -31,15 +31,15 @@ describe("index", () => { `); }); - it(`formats WHERE clause on separate line`, () => { - test(dedent` + it(`formats WHERE clause on separate line`, async () => { + await test(dedent` CREATE INDEX my_index ON my_table (col) WHERE col > 10 `); }); - it(`formats BigQuery CREATE SEARCH INDEX with OPTIONS ()`, () => { - test( + it(`formats BigQuery CREATE SEARCH INDEX with OPTIONS ()`, async () => { + await test( dedent` CREATE SEARCH INDEX my_index ON my_table (col) OPTIONS (analyzer = 'LOG_ANALYZER') @@ -48,28 +48,28 @@ describe("index", () => { ); }); - it(`formats BigQuery CREATE SEARCH INDEX with ALL COLUMNS`, () => { - testBigquery(dedent` + it(`formats BigQuery CREATE SEARCH INDEX with ALL COLUMNS`, async () => { + await testBigquery(dedent` CREATE SEARCH INDEX my_index ON my_table (ALL COLUMNS) `); }); }); describe("drop index", () => { - it(`formats DROP INDEX`, () => { - test(dedent` + it(`formats DROP INDEX`, async () => { + await test(dedent` DROP INDEX my_index `); }); - it(`formats IF EXISTS`, () => { - test(dedent` + it(`formats IF EXISTS`, async () => { + await test(dedent` DROP INDEX IF EXISTS my_index `); }); - it(`formats DROP SEARCH INDEX`, () => { - testBigquery(dedent` + it(`formats DROP SEARCH INDEX`, async () => { + await testBigquery(dedent` DROP SEARCH INDEX my_index ON my_table `); }); diff --git a/test/ddl/procedure.test.ts b/test/ddl/procedure.test.ts index d9f79b6..97a505d 100644 --- a/test/ddl/procedure.test.ts +++ b/test/ddl/procedure.test.ts @@ -3,8 +3,8 @@ import { testBigquery } from "../test_utils"; describe("procedure", () => { describe("create procedure", () => { - it(`formats CREATE PROCEDURE`, () => { - testBigquery( + it(`formats CREATE PROCEDURE`, async () => { + await testBigquery( dedent` CREATE PROCEDURE drop_my_table(arg1 INT64, OUT arg2 STRING) BEGIN @@ -14,8 +14,8 @@ describe("procedure", () => { ); }); - it(`formats OR REPLACE / IF NOT EXISTS`, () => { - testBigquery( + it(`formats OR REPLACE / IF NOT EXISTS`, async () => { + await testBigquery( dedent` CREATE OR REPLACE PROCEDURE IF NOT EXISTS drop_my_table() BEGIN @@ -25,8 +25,8 @@ describe("procedure", () => { ); }); - it(`formats long parameter list`, () => { - testBigquery( + it(`formats long parameter list`, async () => { + await testBigquery( dedent` CREATE PROCEDURE my_schema.my_long_procedure_name( IN first_parameter INT64, @@ -40,8 +40,8 @@ describe("procedure", () => { ); }); - it(`formats OPTIONS (..)`, () => { - testBigquery( + it(`formats OPTIONS (..)`, async () => { + await testBigquery( dedent` CREATE PROCEDURE foo() OPTIONS (strict_mode = TRUE) @@ -52,8 +52,8 @@ describe("procedure", () => { ); }); - it(`formats remote python procedure`, () => { - testBigquery( + it(`formats remote python procedure`, async () => { + await testBigquery( dedent` CREATE PROCEDURE my_bq_project.my_dataset.spark_proc() WITH CONNECTION \`my-project-id.us.my-connection\` @@ -63,8 +63,8 @@ describe("procedure", () => { ); }); - it(`formats inline python procedure`, () => { - testBigquery( + it(`formats inline python procedure`, async () => { + await testBigquery( dedent` CREATE PROCEDURE spark_proc() WITH CONNECTION my_connection @@ -82,12 +82,12 @@ describe("procedure", () => { }); describe("drop procedure", () => { - it(`formats DROP PROCEDURE`, () => { - testBigquery(`DROP PROCEDURE mydataset.myProcedure`); + it(`formats DROP PROCEDURE`, async () => { + await testBigquery(`DROP PROCEDURE mydataset.myProcedure`); }); - it(`formats IF EXISTS`, () => { - testBigquery(`DROP PROCEDURE IF EXISTS foo`); + it(`formats IF EXISTS`, async () => { + await testBigquery(`DROP PROCEDURE IF EXISTS foo`); }); }); }); diff --git a/test/ddl/schema.test.ts b/test/ddl/schema.test.ts index ca83223..a533de0 100644 --- a/test/ddl/schema.test.ts +++ b/test/ddl/schema.test.ts @@ -3,24 +3,24 @@ import { testBigquery } from "../test_utils"; describe("schema", () => { describe("create schema", () => { - it(`formats CREATE SCHEMA`, () => { - testBigquery( + it(`formats CREATE SCHEMA`, async () => { + await testBigquery( dedent` CREATE SCHEMA schema_name ` ); }); - it(`formats IF NOT EXISTS`, () => { - testBigquery( + it(`formats IF NOT EXISTS`, async () => { + await testBigquery( dedent` CREATE SCHEMA IF NOT EXISTS schema_name ` ); }); - it(`formats OPTIONS (..)`, () => { - testBigquery( + it(`formats OPTIONS (..)`, async () => { + await testBigquery( dedent` CREATE SCHEMA schema_name OPTIONS (friendly_name = 'Happy schema') @@ -28,8 +28,8 @@ describe("schema", () => { ); }); - it(`formats DEFAULT COLLATE`, () => { - testBigquery( + it(`formats DEFAULT COLLATE`, async () => { + await testBigquery( dedent` CREATE SCHEMA schema_name DEFAULT COLLATE 'und:ci' @@ -39,24 +39,24 @@ describe("schema", () => { }); describe("drop schema", () => { - it(`formats DROP SCHEMA`, () => { - testBigquery( + it(`formats DROP SCHEMA`, async () => { + await testBigquery( dedent` DROP SCHEMA schema_name ` ); }); - it(`formats IF EXISTS`, () => { - testBigquery( + it(`formats IF EXISTS`, async () => { + await testBigquery( dedent` DROP SCHEMA IF EXISTS schema_name ` ); }); - it(`formats CASCADE/RESTRICT`, () => { - testBigquery( + it(`formats CASCADE/RESTRICT`, async () => { + await testBigquery( dedent` DROP SCHEMA schema_name CASCADE ` @@ -65,8 +65,8 @@ describe("schema", () => { }); describe("alter schema", () => { - it(`formats ALTER SCHEMA .. SET OPTIONS`, () => { - testBigquery( + it(`formats ALTER SCHEMA .. SET OPTIONS`, async () => { + await testBigquery( dedent` ALTER SCHEMA IF EXISTS my_schema SET OPTIONS (description = 'blah') @@ -74,8 +74,8 @@ describe("schema", () => { ); }); - it(`formats ALTER SCHEMA .. SET DEFAULT COLLATE`, () => { - testBigquery( + it(`formats ALTER SCHEMA .. SET DEFAULT COLLATE`, async () => { + await testBigquery( dedent` ALTER SCHEMA my_schema SET DEFAULT COLLATE 'und:ci' diff --git a/test/ddl/trigger.test.ts b/test/ddl/trigger.test.ts index c581e24..e8a7cea 100644 --- a/test/ddl/trigger.test.ts +++ b/test/ddl/trigger.test.ts @@ -3,8 +3,8 @@ import { test } from "../test_utils"; describe("trigger", () => { describe("create trigger", () => { - it(`formats CREATE TRIGGER .. INSTEAD OF UPDATE OF`, () => { - test(dedent` + it(`formats CREATE TRIGGER .. INSTEAD OF UPDATE OF`, async () => { + await test(dedent` CREATE TRIGGER cust_addr_chng INSTEAD OF UPDATE OF cust_addr ON customer_address BEGIN @@ -15,8 +15,8 @@ describe("trigger", () => { `); }); - it(`formats long UPDATE OF column list`, () => { - test(dedent` + it(`formats long UPDATE OF column list`, async () => { + await test(dedent` CREATE TRIGGER cust_addr_chng INSTEAD OF UPDATE OF cust_address, @@ -29,8 +29,8 @@ describe("trigger", () => { `); }); - it(`formats TEMPORARY TRIGGER IF NOT EXISTS`, () => { - test(dedent` + it(`formats TEMPORARY TRIGGER IF NOT EXISTS`, async () => { + await test(dedent` CREATE TEMPORARY TRIGGER IF NOT EXISTS cust_addr_del DELETE ON customer_address BEGIN @@ -39,8 +39,8 @@ describe("trigger", () => { `); }); - it(`formats FOR EACH ROW`, () => { - test(dedent` + it(`formats FOR EACH ROW`, async () => { + await test(dedent` CREATE TRIGGER cust_addr_del INSERT ON customer_address FOR EACH ROW @@ -51,8 +51,8 @@ describe("trigger", () => { `); }); - it(`formats WHEN condition`, () => { - test(dedent` + it(`formats WHEN condition`, async () => { + await test(dedent` CREATE TRIGGER cust_addr_del INSERT ON customer_address FOR EACH ROW @@ -63,8 +63,8 @@ describe("trigger", () => { `); }); - it(`formats long WHEN condition`, () => { - test(dedent` + it(`formats long WHEN condition`, async () => { + await test(dedent` CREATE TRIGGER cust_addr_del INSERT ON customer_address WHEN @@ -79,12 +79,12 @@ describe("trigger", () => { }); describe("drop trigger", () => { - it(`formats DROP TRIGGER`, () => { - test(`DROP TRIGGER my_trigger`); + it(`formats DROP TRIGGER`, async () => { + await test(`DROP TRIGGER my_trigger`); }); - it(`formats IF EXISTS`, () => { - test(`DROP TRIGGER IF EXISTS my_trigger`); + it(`formats IF EXISTS`, async () => { + await test(`DROP TRIGGER IF EXISTS my_trigger`); }); }); }); diff --git a/test/ddl/view.test.ts b/test/ddl/view.test.ts index 93d5f92..eac4ed0 100644 --- a/test/ddl/view.test.ts +++ b/test/ddl/view.test.ts @@ -3,22 +3,22 @@ import { test, testBigquery } from "../test_utils"; describe("view", () => { describe("create view", () => { - it(`formats CREATE VIEW`, () => { - test(dedent` + it(`formats CREATE VIEW`, async () => { + await test(dedent` CREATE VIEW active_client_id AS SELECT id FROM client WHERE active = TRUE `); }); - it(`formats CREATE TEMPORARY VIEW IF NOT EXISTS`, () => { - test(dedent` + it(`formats CREATE TEMPORARY VIEW IF NOT EXISTS`, async () => { + await test(dedent` CREATE TEMPORARY VIEW IF NOT EXISTS active_client_id AS SELECT 1 `); }); - it(`formats CREATE OR REPLACE VIEW`, () => { - testBigquery( + it(`formats CREATE OR REPLACE VIEW`, async () => { + await testBigquery( dedent` CREATE OR REPLACE VIEW active_client_id AS SELECT 1 @@ -26,15 +26,15 @@ describe("view", () => { ); }); - it(`formats CREATE VIEW with column list`, () => { - test(dedent` + it(`formats CREATE VIEW with column list`, async () => { + await test(dedent` CREATE VIEW foobar (col1, col2, col3) AS SELECT 1 `); }); - it(`formats CREATE VIEW with long column list`, () => { - test(dedent` + it(`formats CREATE VIEW with long column list`, async () => { + await test(dedent` CREATE VIEW active_client_in_queue ( client_name, client_org_name, @@ -45,8 +45,8 @@ describe("view", () => { `); }); - it(`formats CREATE VIEW with BigQuery options`, () => { - testBigquery( + it(`formats CREATE VIEW with BigQuery options`, async () => { + await testBigquery( dedent` CREATE VIEW foo OPTIONS (friendly_name = "newview") @@ -56,8 +56,8 @@ describe("view", () => { ); }); - it(`formats simple CREATE MATERIALIZED VIEW`, () => { - testBigquery( + it(`formats simple CREATE MATERIALIZED VIEW`, async () => { + await testBigquery( dedent` CREATE MATERIALIZED VIEW foo AS SELECT 1 @@ -65,8 +65,8 @@ describe("view", () => { ); }); - it(`formats CREATE MATERIALIZED VIEW with extra clauses`, () => { - testBigquery( + it(`formats CREATE MATERIALIZED VIEW with extra clauses`, async () => { + await testBigquery( dedent` CREATE MATERIALIZED VIEW foo PARTITION BY DATE(col_datetime) @@ -79,22 +79,22 @@ describe("view", () => { }); describe("drop view", () => { - it(`formats DROP VIEW`, () => { - test(`DROP VIEW active_client_view`); + it(`formats DROP VIEW`, async () => { + await test(`DROP VIEW active_client_view`); }); - it(`formats DROP VIEW IF EXISTS`, () => { - test(`DROP VIEW IF EXISTS my_schema.active_client_view`); + it(`formats DROP VIEW IF EXISTS`, async () => { + await test(`DROP VIEW IF EXISTS my_schema.active_client_view`); }); - it(`formats DROP MATERIALIZED VIEW`, () => { - testBigquery(`DROP MATERIALIZED VIEW foo`); + it(`formats DROP MATERIALIZED VIEW`, async () => { + await testBigquery(`DROP MATERIALIZED VIEW foo`); }); }); describe("alter view", () => { - it(`formats ALTER VIEW .. SET OPTIONS`, () => { - testBigquery( + it(`formats ALTER VIEW .. SET OPTIONS`, async () => { + await testBigquery( dedent` ALTER VIEW IF EXISTS my_view SET OPTIONS (description = 'blah') @@ -102,8 +102,8 @@ describe("view", () => { ); }); - it(`formats ALTER MATERIALIZED VIEW .. SET OPTIONS`, () => { - testBigquery( + it(`formats ALTER MATERIALIZED VIEW .. SET OPTIONS`, async () => { + await testBigquery( dedent` ALTER MATERIALIZED VIEW my_view SET OPTIONS (description = 'blah') diff --git a/test/dml/delete.test.ts b/test/dml/delete.test.ts index a2ecf41..3d788aa 100644 --- a/test/dml/delete.test.ts +++ b/test/dml/delete.test.ts @@ -2,22 +2,22 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("delete", () => { - it(`formats DELETE statement`, () => { - test(dedent` + it(`formats DELETE statement`, async () => { + await test(dedent` DELETE FROM employee WHERE id = 10 `); }); - it(`formats DELETE without FROM`, () => { - testBigquery(dedent` + it(`formats DELETE without FROM`, async () => { + await testBigquery(dedent` DELETE employee WHERE id = 10 `); }); - it(`formats DELETE statement with RETURNING clause`, () => { - test(dedent` + it(`formats DELETE statement with RETURNING clause`, async () => { + await test(dedent` DELETE FROM employee WHERE id = 10 RETURNING @@ -27,8 +27,8 @@ describe("delete", () => { `); }); - it(`formats DELETE statement with ORDER BY and LIMIT`, () => { - test(dedent` + it(`formats DELETE statement with ORDER BY and LIMIT`, async () => { + await test(dedent` DELETE FROM employee WHERE id = 10 ORDER BY name diff --git a/test/dml/insert.test.ts b/test/dml/insert.test.ts index 622b99d..62b811e 100644 --- a/test/dml/insert.test.ts +++ b/test/dml/insert.test.ts @@ -2,24 +2,24 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("insert", () => { - it(`formats INSERT statement without column names`, () => { - test(dedent` + it(`formats INSERT statement without column names`, async () => { + await test(dedent` INSERT INTO client VALUES (1, 'John', 'Doe', 27) `); }); - it(`formats INSERT statement without INTO`, () => { - testBigquery(dedent` + it(`formats INSERT statement without INTO`, async () => { + await testBigquery(dedent` INSERT client VALUES (1, 2, 3) `); }); - it(`formats INSERT statement with column names`, () => { - test(dedent` + it(`formats INSERT statement with column names`, async () => { + await test(dedent` INSERT INTO client (id, fname, lname, org_id) VALUES @@ -27,8 +27,8 @@ describe("insert", () => { `); }); - it(`formats INSERT statement with multiple rows always to multiple lines`, () => { - test(dedent` + it(`formats INSERT statement with multiple rows always to multiple lines`, async () => { + await test(dedent` INSERT INTO client VALUES (1, 'John', 'Doe', 27), @@ -36,8 +36,8 @@ describe("insert", () => { `); }); - it(`formats INSERT statement with long column names list`, () => { - test(dedent` + it(`formats INSERT statement with long column names list`, async () => { + await test(dedent` INSERT INTO client (id, first_name, last_name, organization_id, project_access_enabled) VALUES @@ -47,8 +47,8 @@ describe("insert", () => { `); }); - it(`formats INSERT statement with very long column names and values lists`, () => { - test(dedent` + it(`formats INSERT statement with very long column names and values lists`, async () => { + await test(dedent` INSERT INTO client ( id, @@ -71,38 +71,38 @@ describe("insert", () => { `); }); - it(`formats OR ABORT modifier`, () => { - test(dedent` + it(`formats OR ABORT modifier`, async () => { + await test(dedent` INSERT OR ABORT INTO employee VALUES (1, 2, 3) `); }); - it("formats insertion of DEFAULT VALUES", () => { - test(dedent` + it("formats insertion of DEFAULT VALUES", async () => { + await test(dedent` INSERT INTO employee DEFAULT VALUES `); }); - it("formats DEFAULT values among normal values", () => { - testBigquery(dedent` + it("formats DEFAULT values among normal values", async () => { + await testBigquery(dedent` INSERT INTO employee VALUES (1, 2, DEFAULT, 3) `); }); - it("formats insertion of query", () => { - test(dedent` + it("formats insertion of query", async () => { + await test(dedent` INSERT INTO employee SELECT * FROM tbl `); }); - it("formats upsert clauses", () => { - test(dedent` + it("formats upsert clauses", async () => { + await test(dedent` INSERT INTO client VALUES (1, 2, 3) @@ -114,8 +114,8 @@ describe("insert", () => { `); }); - it(`formats INSERT with RETURNING clause`, () => { - test(dedent` + it(`formats INSERT with RETURNING clause`, async () => { + await test(dedent` INSERT INTO client VALUES (1, 2, 3) diff --git a/test/dml/merge.test.ts b/test/dml/merge.test.ts index fb48422..1a9c334 100644 --- a/test/dml/merge.test.ts +++ b/test/dml/merge.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("merge", () => { - it(`formats MERGE .. DELETE`, () => { - testBigquery( + it(`formats MERGE .. DELETE`, async () => { + await testBigquery( dedent` MERGE INTO dataset.DetailedInventory AS target USING dataset.Inventory AS source @@ -14,8 +14,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. INSERT (cols) VALUES`, () => { - testBigquery( + it(`formats MERGE .. INSERT (cols) VALUES`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -29,8 +29,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. INSERT VALUES`, () => { - testBigquery( + it(`formats MERGE .. INSERT VALUES`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -43,8 +43,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. INSERT ROW`, () => { - testBigquery( + it(`formats MERGE .. INSERT ROW`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -55,8 +55,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. INSERT (columns) ROW`, () => { - testBigquery( + it(`formats MERGE .. INSERT (columns) ROW`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -69,8 +69,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. UPDATE`, () => { - testBigquery( + it(`formats MERGE .. UPDATE`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -84,8 +84,8 @@ describe("merge", () => { ); }); - it(`formats MERGE .. UPDATE with single-element update`, () => { - testBigquery( + it(`formats MERGE .. UPDATE with single-element update`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -96,8 +96,8 @@ describe("merge", () => { ); }); - it(`formats long ON-condition`, () => { - testBigquery( + it(`formats long ON-condition`, async () => { + await testBigquery( dedent` MERGE INTO target USING source @@ -111,8 +111,8 @@ describe("merge", () => { ); }); - it(`formats long WHEN-condition`, () => { - testBigquery( + it(`formats long WHEN-condition`, async () => { + await testBigquery( dedent` MERGE INTO target USING source diff --git a/test/dml/truncate.test.ts b/test/dml/truncate.test.ts index 78dd7ea..7038309 100644 --- a/test/dml/truncate.test.ts +++ b/test/dml/truncate.test.ts @@ -1,7 +1,7 @@ import { testBigquery } from "../test_utils"; describe("truncate", () => { - it(`formats TRUNCATE TABLE statement`, () => { - testBigquery(`TRUNCATE TABLE dataset.employee`); + it(`formats TRUNCATE TABLE statement`, async () => { + await testBigquery(`TRUNCATE TABLE dataset.employee`); }); }); diff --git a/test/dml/update.test.ts b/test/dml/update.test.ts index 122279e..f6a83f8 100644 --- a/test/dml/update.test.ts +++ b/test/dml/update.test.ts @@ -2,16 +2,16 @@ import dedent from "dedent-js"; import { test } from "../test_utils"; describe("update", () => { - it(`formats UPDATE statement`, () => { - test(dedent` + it(`formats UPDATE statement`, async () => { + await test(dedent` UPDATE employee SET salary = 1000 WHERE id = 10 `); }); - it(`formats UPDATE statement with multiple assignments`, () => { - test(dedent` + it(`formats UPDATE statement with multiple assignments`, async () => { + await test(dedent` UPDATE employee SET name = 'John Doe', @@ -21,8 +21,8 @@ describe("update", () => { `); }); - it(`formats UPDATE with parenthesized column groups`, () => { - test(dedent` + it(`formats UPDATE with parenthesized column groups`, async () => { + await test(dedent` UPDATE employee SET (name, salary) = ('John Doe', 1000), @@ -30,15 +30,15 @@ describe("update", () => { `); }); - it(`formats OR ABORT modifier`, () => { - test(dedent` + it(`formats OR ABORT modifier`, async () => { + await test(dedent` UPDATE OR ABORT employee SET salary = 1000 `); }); - it(`formats UPDATE with RETURNING clause`, () => { - test(dedent` + it(`formats UPDATE with RETURNING clause`, async () => { + await test(dedent` UPDATE client SET status = 2 RETURNING * diff --git a/test/explain.test.ts b/test/explain.test.ts index 9bd27cc..6da29a7 100644 --- a/test/explain.test.ts +++ b/test/explain.test.ts @@ -2,16 +2,16 @@ import dedent from "dedent-js"; import { test } from "./test_utils"; describe("explain", () => { - it(`formats EXPLAIN statement`, () => { - test(`EXPLAIN SELECT 1`); + it(`formats EXPLAIN statement`, async () => { + await test(`EXPLAIN SELECT 1`); }); - it(`formats EXPLAIN QUERY PLAIN statement`, () => { - test(`EXPLAIN QUERY PLAN SELECT 1`); + it(`formats EXPLAIN QUERY PLAIN statement`, async () => { + await test(`EXPLAIN QUERY PLAN SELECT 1`); }); - it(`formats long EXPLAIN statement to multiple lines`, () => { - test(dedent` + it(`formats long EXPLAIN statement to multiple lines`, async () => { + await test(dedent` EXPLAIN SELECT id, name, item_count FROM inventory @@ -19,8 +19,8 @@ describe("explain", () => { `); }); - it(`formats long EXPLAIN QUERY PLAN statement to multiple lines`, () => { - test(dedent` + it(`formats long EXPLAIN QUERY PLAN statement to multiple lines`, async () => { + await test(dedent` EXPLAIN QUERY PLAN SELECT id, name, item_count FROM inventory diff --git a/test/expr/expr.test.ts b/test/expr/expr.test.ts index 5a08452..2ed2a6a 100644 --- a/test/expr/expr.test.ts +++ b/test/expr/expr.test.ts @@ -2,9 +2,9 @@ import dedent from "dedent-js"; import { pretty, test, testBigquery } from "../test_utils"; describe("expr", () => { - it(`formats binary expressions`, () => { + it(`formats binary expressions`, async () => { expect( - pretty(`SELECT 1 + 2 / 3 * (5 - 1), TRUE OR FALSE AND TRUE`, { + await pretty(`SELECT 1 + 2 / 3 * (5 - 1), TRUE OR FALSE AND TRUE`, { printWidth: 25, }) ).toBe(dedent` @@ -14,16 +14,16 @@ describe("expr", () => { `); }); - it(`formats IN expressions`, () => { - test(`SELECT col1 IN (1, 2, 3), col2 NOT IN (4, 5, 6)`); + it(`formats IN expressions`, async () => { + await test(`SELECT col1 IN (1, 2, 3), col2 NOT IN (4, 5, 6)`); }); - it(`formats LIKE expressions`, () => { - test(`SELECT fname LIKE 'Mar%', lname NOT LIKE '%ony'`); + it(`formats LIKE expressions`, async () => { + await test(`SELECT fname LIKE 'Mar%', lname NOT LIKE '%ony'`); }); - it(`formats IS expressions`, () => { - test(dedent` + it(`formats IS expressions`, async () => { + await test(dedent` SELECT x IS NOT NULL, y IS NULL, @@ -32,8 +32,8 @@ describe("expr", () => { `); }); - it(`formats BETWEEN expressions`, () => { - test( + it(`formats BETWEEN expressions`, async () => { + await test( dedent` SELECT x BETWEEN 1 AND 10, @@ -43,8 +43,8 @@ describe("expr", () => { ); }); - it(`formats EXISTS expressions`, () => { - test( + it(`formats EXISTS expressions`, async () => { + await test( dedent` SELECT EXISTS (SELECT * FROM tbl), @@ -54,20 +54,20 @@ describe("expr", () => { ); }); - it(`formats ISNULL / NOTNULL / NOT NULL expressions`, () => { - test(`SELECT fname ISNULL, xname NOTNULL, lname NOT NULL`); + it(`formats ISNULL / NOTNULL / NOT NULL expressions`, async () => { + await test(`SELECT fname ISNULL, xname NOTNULL, lname NOT NULL`); }); - it(`formats NOT expressions`, () => { - test(`SELECT NOT x > 10`); + it(`formats NOT expressions`, async () => { + await test(`SELECT NOT x > 10`); }); - it(`formats negation`, () => { - test(`SELECT -x`); + it(`formats negation`, async () => { + await test(`SELECT -x`); }); - it(`formats a chain of AND/OR operators to multiple lines`, () => { - test(dedent` + it(`formats a chain of AND/OR operators to multiple lines`, async () => { + await test(dedent` SELECT * FROM client WHERE @@ -79,33 +79,33 @@ describe("expr", () => { `); }); - it(`eliminates unnecessary (((nested))) parenthesis`, () => { - expect(pretty(`SELECT (((1 + 2))) * 3`)).toBe(dedent` + it(`eliminates unnecessary (((nested))) parenthesis`, async () => { + expect(await pretty(`SELECT (((1 + 2))) * 3`)).toBe(dedent` SELECT (1 + 2) * 3 `); }); - it(`preserves comments when eliminating (((nested))) parenthesis`, () => { - expect(pretty(`SELECT (/*c1*/(/*c2*/(/*c3*/ 1 + 2))) * 3`)).toBe(dedent` + it(`preserves comments when eliminating (((nested))) parenthesis`, async () => { + expect(await pretty(`SELECT (/*c1*/(/*c2*/(/*c3*/ 1 + 2))) * 3`)).toBe(dedent` SELECT /*c1*/ /*c2*/ (/*c3*/ 1 + 2) * 3 `); }); - it(`eliminates unnecessary parenthesis around function arguments`, () => { - expect(pretty(`SELECT my_func((id), (name))`)).toBe(dedent` + it(`eliminates unnecessary parenthesis around function arguments`, async () => { + expect(await pretty(`SELECT my_func((id), (name))`)).toBe(dedent` SELECT my_func(id, name) `); }); - it(`preserves comments when eliminating func(((arg))) parenthesis`, () => { - expect(pretty(`SELECT count(/*c1*/(/*c2*/ id))`)).toBe(dedent` + it(`preserves comments when eliminating func(((arg))) parenthesis`, async () => { + expect(await pretty(`SELECT count(/*c1*/(/*c2*/ id))`)).toBe(dedent` SELECT count(/*c1*/ /*c2*/ id) `); }); describe("case", () => { - it(`formats CASE expression always on multiple lines`, () => { - test(dedent` + it(`formats CASE expression always on multiple lines`, async () => { + await test(dedent` SELECT CASE x WHEN 1 THEN 'A' @@ -114,8 +114,8 @@ describe("expr", () => { `); }); - it(`formats CASE expression with base expression`, () => { - test(dedent` + it(`formats CASE expression with base expression`, async () => { + await test(dedent` SELECT CASE status WHEN 1 THEN 'good' @@ -125,8 +125,8 @@ describe("expr", () => { `); }); - it(`formats CASE expression without base expression`, () => { - test(dedent` + it(`formats CASE expression without base expression`, async () => { + await test(dedent` SELECT CASE WHEN status = 1 THEN 'good' @@ -138,12 +138,12 @@ describe("expr", () => { }); describe("BigQuery", () => { - it(`formats BigQuery quoted table names`, () => { - testBigquery("SELECT * FROM `my-project.mydataset.mytable`"); + it(`formats BigQuery quoted table names`, async () => { + await testBigquery("SELECT * FROM `my-project.mydataset.mytable`"); }); - it(`formats BigQuery array field access`, () => { - testBigquery(dedent` + it(`formats BigQuery array field access`, async () => { + await testBigquery(dedent` SELECT item_array, item_array[OFFSET(1)] AS item_offset, @@ -153,8 +153,8 @@ describe("expr", () => { `); }); - it(`formats BigQuery array field access to multiple lines`, () => { - testBigquery(dedent` + it(`formats BigQuery array field access to multiple lines`, async () => { + await testBigquery(dedent` SELECT ["Coffee Cup", "Tea Kettle", "Milk Glass"][ SAFE_OFFSET(some_really_long_index_number) @@ -162,14 +162,14 @@ describe("expr", () => { `); }); - it(`formats BigQuery JSON field access`, () => { - testBigquery(dedent` + it(`formats BigQuery JSON field access`, async () => { + await testBigquery(dedent` SELECT json_value.class.students[0]['name'] `); }); - it(`formats BigQuery @@system_variables`, () => { - testBigquery(`SELECT @@error.message`); + it(`formats BigQuery @@system_variables`, async () => { + await testBigquery(`SELECT @@error.message`); }); }); }); diff --git a/test/expr/func.test.ts b/test/expr/func.test.ts index 040c7e0..8227763 100644 --- a/test/expr/func.test.ts +++ b/test/expr/func.test.ts @@ -3,15 +3,15 @@ import { pretty, test, testBigquery } from "../test_utils"; // Functions and function-like language constructs describe("functions", () => { - it(`formats function call to single line`, () => { - expect(pretty(`SELECT sqrt(1, 2, 3)`, { printWidth: 16 })).toBe(dedent` + it(`formats function call to single line`, async () => { + expect(await pretty(`SELECT sqrt(1, 2, 3)`, { printWidth: 16 })).toBe(dedent` SELECT sqrt(1, 2, 3) `); }); - it(`formats function call to multiple lines`, () => { - expect(pretty(`SELECT sqrt(1, 2, 3)`, { printWidth: 10 })).toBe(dedent` + it(`formats function call to multiple lines`, async () => { + expect(await pretty(`SELECT sqrt(1, 2, 3)`, { printWidth: 10 })).toBe(dedent` SELECT sqrt( 1, @@ -21,45 +21,45 @@ describe("functions", () => { `); }); - it(`formats count(*) func call`, () => { - test(`SELECT count(*)`); + it(`formats count(*) func call`, async () => { + await test(`SELECT count(*)`); }); - it(`formats count(DISTINCT) func call`, () => { - test(`SELECT count(DISTINCT id)`); + it(`formats count(DISTINCT) func call`, async () => { + await test(`SELECT count(DISTINCT id)`); }); describe("cast", () => { - it(`formats CAST expression`, () => { - test(`SELECT CAST(127 AS INT)`); + it(`formats CAST expression`, async () => { + await test(`SELECT CAST(127 AS INT)`); }); - it(`formats CAST() with FORMAT`, () => { - testBigquery(`SELECT CAST('11-08' AS DATE FORMAT 'DD-MM')`); - testBigquery( + it(`formats CAST() with FORMAT`, async () => { + await testBigquery(`SELECT CAST('11-08' AS DATE FORMAT 'DD-MM')`); + await testBigquery( `SELECT CAST('12:35' AS TIME FORMAT 'HH:MI' AT TIME ZONE 'UTC')` ); }); }); describe("raise", () => { - it(`formats RAISE expression`, () => { - test(`SELECT RAISE(IGNORE), RAISE(ABORT, 'Oh no!')`); + it(`formats RAISE expression`, async () => { + await test(`SELECT RAISE(IGNORE), RAISE(ABORT, 'Oh no!')`); }); }); describe("extract", () => { - it(`formats EXTRACT() expression`, () => { - testBigquery(`SELECT EXTRACT(MONTH FROM DATE '2002-08-16')`); - testBigquery(`SELECT EXTRACT(WEEK(SUNDAY) FROM date)`); + it(`formats EXTRACT() expression`, async () => { + await testBigquery(`SELECT EXTRACT(MONTH FROM DATE '2002-08-16')`); + await testBigquery(`SELECT EXTRACT(WEEK(SUNDAY) FROM date)`); }); }); describe("any_value", () => { - it(`formats ANY_VALUE() with HAVING`, () => { - testBigquery(`SELECT any_value(fruit)`); - testBigquery(`SELECT any_value(fruit HAVING MAX sold)`); - testBigquery(`SELECT any_value(fruit HAVING MIN sold)`); + it(`formats ANY_VALUE() with HAVING`, async () => { + await testBigquery(`SELECT any_value(fruit)`); + await testBigquery(`SELECT any_value(fruit HAVING MAX sold)`); + await testBigquery(`SELECT any_value(fruit HAVING MIN sold)`); }); }); }); diff --git a/test/expr/json.test.ts b/test/expr/json.test.ts index 81b095f..6f64d2d 100644 --- a/test/expr/json.test.ts +++ b/test/expr/json.test.ts @@ -2,17 +2,17 @@ import dedent from "dedent-js"; import { pretty, testBigquery } from "../test_utils"; describe("json", () => { - it(`formats JSON literals`, () => { - testBigquery( + it(`formats JSON literals`, async () => { + await testBigquery( dedent` SELECT JSON '{ "foo": true }' ` ); }); - it(`formats JSON literal using Prettier JSON formatter`, () => { + it(`formats JSON literal using Prettier JSON formatter`, async () => { expect( - pretty(`SELECT JSON '{"fname":"John","lname":"Doe","valid":true}'`, { + await pretty(`SELECT JSON '{"fname":"John","lname":"Doe","valid":true}'`, { dialect: "bigquery", }) ).toBe( @@ -22,9 +22,9 @@ describe("json", () => { ); }); - it(`formats long JSON literal using Prettier JSON formatter to multiple lines`, () => { + it(`formats long JSON literal using Prettier JSON formatter to multiple lines`, async () => { expect( - pretty( + await pretty( `SELECT JSON '{"firstName":"John","lastName":"Doe","inventory":["Pickaxe", "Compass", "Dirt"]}'`, { dialect: "bigquery" } ) @@ -42,9 +42,9 @@ describe("json", () => { ); }); - it(`converts double-quoted JSON literal to single-quoted one`, () => { + it(`converts double-quoted JSON literal to single-quoted one`, async () => { expect( - pretty(String.raw`SELECT JSON "{\"name\":\"John Doe\"}"`, { + await pretty(String.raw`SELECT JSON "{\"name\":\"John Doe\"}"`, { dialect: "bigquery", }) ).toBe( @@ -54,9 +54,9 @@ describe("json", () => { ); }); - it(`converts triple-quoted JSON literal to single-quoted one when it fits to single line`, () => { + it(`converts triple-quoted JSON literal to single-quoted one when it fits to single line`, async () => { expect( - pretty(`SELECT JSON '''{"name":"John Doe"}'''`, { + await pretty(`SELECT JSON '''{"name":"John Doe"}'''`, { dialect: "bigquery", }) ).toBe( @@ -66,9 +66,9 @@ describe("json", () => { ); }); - it(`converts triple-dbl-quoted JSON literal to triple-single-quoted`, () => { + it(`converts triple-dbl-quoted JSON literal to triple-single-quoted`, async () => { expect( - pretty( + await pretty( `SELECT JSON """{"firstName":"John","lastName":"Doe","inventory":["Pickaxe", "Compass", "Dirt"]}"""`, { dialect: "bigquery" } ) @@ -86,9 +86,9 @@ describe("json", () => { ); }); - it(`always uses triple-quotes when JSON contains single quote character`, () => { + it(`always uses triple-quotes when JSON contains single quote character`, async () => { expect( - pretty(String.raw`SELECT JSON '{"name":"It\'s Mr John"}'`, { + await pretty(String.raw`SELECT JSON '{"name":"It\'s Mr John"}'`, { dialect: "bigquery", }) ).toBe( @@ -99,9 +99,9 @@ describe("json", () => { }); // Just skip formatting in this tricky case for now - it(`doesn't format JSON when it contains triple quotes`, () => { + it(`doesn't format JSON when it contains triple quotes`, async () => { expect( - pretty(String.raw`SELECT JSON '{"name":"It\'\'\'s Mr John"}'`, { + await pretty(String.raw`SELECT JSON '{"name":"It\'\'\'s Mr John"}'`, { dialect: "bigquery", }) ).toBe( @@ -112,12 +112,12 @@ describe("json", () => { }); // Also skip dealing with escapes for now - it(`doesn't format JSON when it contains escape sequences`, () => { - testBigquery(String.raw`SELECT JSON '{ "name": "\\n" }'`); + it(`doesn't format JSON when it contains escape sequences`, async () => { + await testBigquery(String.raw`SELECT JSON '{ "name": "\\n" }'`); }); // Also skip dealing with raw strings - it(`doesn't format JSON inside raw strings`, () => { - testBigquery(`SELECT JSON r'{"name":"John"}'`); + it(`doesn't format JSON inside raw strings`, async () => { + await testBigquery(`SELECT JSON r'{"name":"John"}'`); }); }); diff --git a/test/expr/literal.test.ts b/test/expr/literal.test.ts index 0a775db..ad9972f 100644 --- a/test/expr/literal.test.ts +++ b/test/expr/literal.test.ts @@ -2,12 +2,12 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("literal", () => { - it(`formats BigQuery NUMERIC and BIGNUMERIC literals`, () => { - testBigquery(`SELECT NUMERIC '12345', BIGNUMERIC '1.23456e05'`); + it(`formats BigQuery NUMERIC and BIGNUMERIC literals`, async () => { + await testBigquery(`SELECT NUMERIC '12345', BIGNUMERIC '1.23456e05'`); }); - it(`formats DATE/TIME literals`, () => { - testBigquery( + it(`formats DATE/TIME literals`, async () => { + await testBigquery( dedent` SELECT DATE '2014-09-27', @@ -18,8 +18,8 @@ describe("literal", () => { ); }); - it(`formats INTERVAL literals`, () => { - testBigquery( + it(`formats INTERVAL literals`, async () => { + await testBigquery( dedent` SELECT INTERVAL 5 DAY, @@ -31,8 +31,8 @@ describe("literal", () => { }); describe("array literals", () => { - it(`formats array literals`, () => { - testBigquery( + it(`formats array literals`, async () => { + await testBigquery( dedent` SELECT [1, 2, 3], @@ -43,8 +43,8 @@ describe("literal", () => { ); }); - it(`formats long array literal to multiple lines`, () => { - testBigquery( + it(`formats long array literal to multiple lines`, async () => { + await testBigquery( dedent` SELECT [ @@ -59,8 +59,8 @@ describe("literal", () => { }); describe("struct literals", () => { - it(`formats struct literals`, () => { - testBigquery( + it(`formats struct literals`, async () => { + await testBigquery( dedent` SELECT (1, 2, 3), @@ -72,8 +72,8 @@ describe("literal", () => { ); }); - it(`formats long struct literal to multiple lines`, () => { - testBigquery( + it(`formats long struct literal to multiple lines`, async () => { + await testBigquery( dedent` SELECT STRUCT( diff --git a/test/options/keywordCase.test.ts b/test/options/keywordCase.test.ts index edfde14..cbbe322 100644 --- a/test/options/keywordCase.test.ts +++ b/test/options/keywordCase.test.ts @@ -2,15 +2,15 @@ import dedent from "dedent-js"; import { pretty } from "../test_utils"; describe("sqlKeywordCase option", () => { - it(`defaults to uppercasing of all keywords`, () => { - expect(pretty(`select * From tbl WHERE x > 0`)).toBe(dedent` + it(`defaults to uppercasing of all keywords`, async () => { + expect(await pretty(`select * From tbl WHERE x > 0`)).toBe(dedent` SELECT * FROM tbl WHERE x > 0 `); }); - it(`sqlKeywordCase: "preserve" keeps keywords case as-is`, () => { + it(`sqlKeywordCase: "preserve" keeps keywords case as-is`, async () => { expect( - pretty(`select * From tbl WHERE x > 0`, { + await pretty(`select * From tbl WHERE x > 0`, { sqlKeywordCase: "preserve", }) ).toBe(dedent` @@ -18,9 +18,9 @@ describe("sqlKeywordCase option", () => { `); }); - it(`sqlKeywordCase: "upper" converts keywords to uppercase`, () => { + it(`sqlKeywordCase: "upper" converts keywords to uppercase`, async () => { expect( - pretty(`select * From tbl WHERE x > 0`, { + await pretty(`select * From tbl WHERE x > 0`, { sqlKeywordCase: "upper", }) ).toBe(dedent` @@ -28,9 +28,9 @@ describe("sqlKeywordCase option", () => { `); }); - it(`sqlKeywordCase: "lower" converts keywords to lowercase`, () => { + it(`sqlKeywordCase: "lower" converts keywords to lowercase`, async () => { expect( - pretty(`select * From tbl WHERE x > 0`, { + await pretty(`select * From tbl WHERE x > 0`, { sqlKeywordCase: "lower", }) ).toBe(dedent` diff --git a/test/options/paramTypes.test.ts b/test/options/paramTypes.test.ts index 3dc634c..fba954b 100644 --- a/test/options/paramTypes.test.ts +++ b/test/options/paramTypes.test.ts @@ -1,30 +1,30 @@ import { pretty, test } from "../test_utils"; describe("sqlParamTypes option", () => { - it(`by default bound parameters are not supported`, () => { - expect(() => pretty(`SELECT * FROM tbl WHERE x = ?`)).toThrowError(); + it(`by default bound parameters are not supported`, async () => { + await expect(pretty(`SELECT * FROM tbl WHERE x = ?`)).rejects.toThrowError(); }); - it(`positional parameters: ?`, () => { - test(`SELECT * FROM tbl WHERE x = ? AND y = ?`, { + it(`positional parameters: ?`, async () => { + await test(`SELECT * FROM tbl WHERE x = ? AND y = ?`, { sqlParamTypes: ["?"], }); }); - it(`indexed parameters: ?nr`, () => { - test(`SELECT * FROM tbl WHERE x = ?1 AND y = ?2`, { + it(`indexed parameters: ?nr`, async () => { + await test(`SELECT * FROM tbl WHERE x = ?1 AND y = ?2`, { sqlParamTypes: ["?nr"], }); }); - it(`named parameters: :name`, () => { - test(`SELECT * FROM tbl WHERE x = :foo AND y = :bar`, { + it(`named parameters: :name`, async () => { + await test(`SELECT * FROM tbl WHERE x = :foo AND y = :bar`, { sqlParamTypes: [":name"], }); }); - it(`mix of different parameter types`, () => { - test(`SELECT * FROM tbl WHERE x = @foo AND y = $bar`, { + it(`mix of different parameter types`, async () => { + await test(`SELECT * FROM tbl WHERE x = @foo AND y = $bar`, { sqlParamTypes: ["@name", "$name"], }); }); diff --git a/test/proc/block.test.ts b/test/proc/block.test.ts index ecb62d0..46d486e 100644 --- a/test/proc/block.test.ts +++ b/test/proc/block.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("block statement", () => { - it(`formats BEGIN .. END`, () => { - testBigquery(dedent` + it(`formats BEGIN .. END`, async () => { + await testBigquery(dedent` BEGIN SELECT 1; SELECT 2; @@ -12,8 +12,8 @@ describe("block statement", () => { `); }); - it(`formats BEGIN .. EXCEPTION .. END`, () => { - testBigquery(dedent` + it(`formats BEGIN .. EXCEPTION .. END`, async () => { + await testBigquery(dedent` BEGIN SELECT 1; EXCEPTION WHEN ERROR THEN diff --git a/test/proc/call.test.ts b/test/proc/call.test.ts index d171ac5..18accb3 100644 --- a/test/proc/call.test.ts +++ b/test/proc/call.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("call", () => { - it(`formats CALL statement`, () => { - testBigquery(dedent` + it(`formats CALL statement`, async () => { + await testBigquery(dedent` CALL proc_name(arg1, arg2, arg3) `); }); diff --git a/test/proc/case.test.ts b/test/proc/case.test.ts index 839899b..68999a7 100644 --- a/test/proc/case.test.ts +++ b/test/proc/case.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("case", () => { - it(`formats procedural CASE`, () => { - testBigquery(dedent` + it(`formats procedural CASE`, async () => { + await testBigquery(dedent` CASE foo WHEN 1 THEN SELECT CONCAT('Product one'); diff --git a/test/proc/declare.test.ts b/test/proc/declare.test.ts index e61079b..843fe1f 100644 --- a/test/proc/declare.test.ts +++ b/test/proc/declare.test.ts @@ -2,26 +2,26 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("declare", () => { - it(`formats basic DECLARE statement`, () => { - testBigquery(dedent` + it(`formats basic DECLARE statement`, async () => { + await testBigquery(dedent` DECLARE x `); }); - it(`formats DECLARE with type`, () => { - testBigquery(dedent` + it(`formats DECLARE with type`, async () => { + await testBigquery(dedent` DECLARE x INT64 `); }); - it(`formats declaring of multiple variables`, () => { - testBigquery(dedent` + it(`formats declaring of multiple variables`, async () => { + await testBigquery(dedent` DECLARE foo, bar, baz INT64 `); }); - it(`formats DEFAULT`, () => { - testBigquery(dedent` + it(`formats DEFAULT`, async () => { + await testBigquery(dedent` DECLARE d DATE DEFAULT CURRENT_DATE() `); }); diff --git a/test/proc/if.test.ts b/test/proc/if.test.ts index d14331b..d8f3403 100644 --- a/test/proc/if.test.ts +++ b/test/proc/if.test.ts @@ -2,16 +2,16 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("if", () => { - it(`formats IF .. THEN .. END IF`, () => { - testBigquery(dedent` + it(`formats IF .. THEN .. END IF`, async () => { + await testBigquery(dedent` IF x > 10 THEN SELECT 1; END IF `); }); - it(`formats ELSE`, () => { - testBigquery(dedent` + it(`formats ELSE`, async () => { + await testBigquery(dedent` IF x > 10 THEN SELECT 1; ELSE @@ -20,8 +20,8 @@ describe("if", () => { `); }); - it(`formats ELSEIF`, () => { - testBigquery(dedent` + it(`formats ELSEIF`, async () => { + await testBigquery(dedent` IF x > 10 THEN SELECT 1; ELSEIF x > 1 THEN @@ -34,8 +34,8 @@ describe("if", () => { `); }); - it(`formats IF with multiple statements inside`, () => { - testBigquery(dedent` + it(`formats IF with multiple statements inside`, async () => { + await testBigquery(dedent` IF x > 10 THEN SELECT 1; SELECT 2; @@ -44,8 +44,8 @@ describe("if", () => { `); }); - it(`formats IF with long condition`, () => { - testBigquery(dedent` + it(`formats IF with long condition`, async () => { + await testBigquery(dedent` IF EXISTS (SELECT 1 FROM schema.products WHERE product_id = target_product_id) AND target_product_id IS NOT NULL @@ -55,8 +55,8 @@ describe("if", () => { `); }); - it(`formats ELSEIF with long condition`, () => { - testBigquery(dedent` + it(`formats ELSEIF with long condition`, async () => { + await testBigquery(dedent` IF TRUE THEN SELECT 1; ELSEIF diff --git a/test/proc/loops.test.ts b/test/proc/loops.test.ts index 001d28b..000ac17 100644 --- a/test/proc/loops.test.ts +++ b/test/proc/loops.test.ts @@ -2,40 +2,40 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("loops", () => { - it(`formats LOOP`, () => { - testBigquery(dedent` + it(`formats LOOP`, async () => { + await testBigquery(dedent` LOOP SELECT 1; END LOOP `); }); - it(`formats REPEAT`, () => { - testBigquery(dedent` + it(`formats REPEAT`, async () => { + await testBigquery(dedent` REPEAT SET x = x + 1; UNTIL x > 10 END REPEAT `); }); - it(`formats WHILE`, () => { - testBigquery(dedent` + it(`formats WHILE`, async () => { + await testBigquery(dedent` WHILE x < 10 DO SET x = x + 1; END WHILE `); }); - it(`formats FOR .. IN`, () => { - testBigquery(dedent` + it(`formats FOR .. IN`, async () => { + await testBigquery(dedent` FOR record IN (SELECT * FROM tbl) DO SELECT record.foo, record.bar; END FOR `); }); - it(`formats BREAK/CONTINUE`, () => { - testBigquery(dedent` + it(`formats BREAK/CONTINUE`, async () => { + await testBigquery(dedent` LOOP IF TRUE THEN BREAK; @@ -46,8 +46,8 @@ describe("loops", () => { `); }); - it(`formats labels`, () => { - testBigquery(dedent` + it(`formats labels`, async () => { + await testBigquery(dedent` outer_loop: LOOP inner_loop: LOOP BREAK outer_loop; @@ -56,8 +56,8 @@ describe("loops", () => { `); }); - it(`formats end labels`, () => { - testBigquery(dedent` + it(`formats end labels`, async () => { + await testBigquery(dedent` outer_loop: REPEAT inner_loop: LOOP CONTINUE outer_loop; diff --git a/test/proc/prepared_statements.test.ts b/test/proc/prepared_statements.test.ts index 8edef85..55b2936 100644 --- a/test/proc/prepared_statements.test.ts +++ b/test/proc/prepared_statements.test.ts @@ -2,22 +2,22 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("prepared statements", () => { - it(`formats EXECUTE IMMEDIATE`, () => { - testBigquery(dedent` + it(`formats EXECUTE IMMEDIATE`, async () => { + await testBigquery(dedent` EXECUTE IMMEDIATE 'SELECT * FROM tbl' `); }); - it(`formats EXECUTE IMMEDIATE with INTO and USING`, () => { - testBigquery(dedent` + it(`formats EXECUTE IMMEDIATE with INTO and USING`, async () => { + await testBigquery(dedent` EXECUTE IMMEDIATE 'SELECT ? + ?' INTO sum USING 1, 2 `); }); - it(`formats EXECUTE IMMEDIATE with long query`, () => { - testBigquery(dedent` + it(`formats EXECUTE IMMEDIATE with long query`, async () => { + await testBigquery(dedent` EXECUTE IMMEDIATE 'SELECT count(*) FROM myschema.mytable WHERE operations > 10 AND name IS NOT NULL' INTO cnt diff --git a/test/proc/raise.test.ts b/test/proc/raise.test.ts index aaaeff5..419f407 100644 --- a/test/proc/raise.test.ts +++ b/test/proc/raise.test.ts @@ -2,14 +2,14 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("raise", () => { - it(`formats RAISE statement`, () => { - testBigquery(dedent` + it(`formats RAISE statement`, async () => { + await testBigquery(dedent` RAISE `); }); - it(`formats RAISE with message`, () => { - testBigquery(dedent` + it(`formats RAISE with message`, async () => { + await testBigquery(dedent` RAISE USING MESSAGE = 'Serious error!' `); }); diff --git a/test/proc/return.test.ts b/test/proc/return.test.ts index 699f9cc..ce5a4a8 100644 --- a/test/proc/return.test.ts +++ b/test/proc/return.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("return", () => { - it(`formats RETURN statement`, () => { - testBigquery(dedent` + it(`formats RETURN statement`, async () => { + await testBigquery(dedent` RETURN `); }); diff --git a/test/proc/set.test.ts b/test/proc/set.test.ts index 469cbf6..b2e4770 100644 --- a/test/proc/set.test.ts +++ b/test/proc/set.test.ts @@ -2,20 +2,20 @@ import dedent from "dedent-js"; import { testBigquery } from "../test_utils"; describe("set", () => { - it(`formats basic SET statement`, () => { - testBigquery(dedent` + it(`formats basic SET statement`, async () => { + await testBigquery(dedent` SET x = 1 `); }); - it(`formats multi-assignment SET`, () => { - testBigquery(dedent` + it(`formats multi-assignment SET`, async () => { + await testBigquery(dedent` SET (x, y, z) = (1, 2, 3) `); }); - it(`formats long SET expressions`, () => { - testBigquery(dedent` + it(`formats long SET expressions`, async () => { + await testBigquery(dedent` SET (first_variable, second_variable) = ( FORMAT('%d', word_count), FORMAT('%d', line_count) @@ -23,8 +23,8 @@ describe("set", () => { `); }); - it(`formats long SET variable list`, () => { - testBigquery(dedent` + it(`formats long SET variable list`, async () => { + await testBigquery(dedent` SET ( first_variable, second_variable, diff --git a/test/select/from.test.ts b/test/select/from.test.ts index aba0f41..708545e 100644 --- a/test/select/from.test.ts +++ b/test/select/from.test.ts @@ -2,8 +2,8 @@ import dedent from "dedent-js"; import { test, testBigquery } from "../test_utils"; describe("select FROM", () => { - it(`formats join always to multiple lines`, () => { - test(dedent` + it(`formats join always to multiple lines`, async () => { + await test(dedent` SELECT * FROM client @@ -11,8 +11,8 @@ describe("select FROM", () => { `); }); - it(`formats FROM with a long join to multiple lines`, () => { - test(dedent` + it(`formats FROM with a long join to multiple lines`, async () => { + await test(dedent` SELECT * FROM client_relation @@ -20,8 +20,8 @@ describe("select FROM", () => { `); }); - it(`formats FROM with multiple joins to multiple lines`, () => { - test(dedent` + it(`formats FROM with multiple joins to multiple lines`, async () => { + await test(dedent` SELECT * FROM client @@ -30,8 +30,8 @@ describe("select FROM", () => { `); }); - it(`formats FROM joins with USING-specification`, () => { - test(dedent` + it(`formats FROM joins with USING-specification`, async () => { + await test(dedent` SELECT * FROM client @@ -40,8 +40,8 @@ describe("select FROM", () => { `); }); - it(`formats long join specifications to separate lines`, () => { - test(dedent` + it(`formats long join specifications to separate lines`, async () => { + await test(dedent` SELECT * FROM client @@ -52,8 +52,8 @@ describe("select FROM", () => { `); }); - it(`formats table aliases`, () => { - test(dedent` + it(`formats table aliases`, async () => { + await test(dedent` SELECT * FROM client AS c @@ -61,8 +61,8 @@ describe("select FROM", () => { `); }); - it(`formats joins with subqueries`, () => { - test(dedent` + it(`formats joins with subqueries`, async () => { + await test(dedent` SELECT * FROM client @@ -71,8 +71,8 @@ describe("select FROM", () => { `); }); - it(`formats joins with table functions`, () => { - test(dedent` + it(`formats joins with table functions`, async () => { + await test(dedent` SELECT * FROM client @@ -81,8 +81,8 @@ describe("select FROM", () => { `); }); - it(`formats comma-operator cross-joins`, () => { - test(dedent` + it(`formats comma-operator cross-joins`, async () => { + await test(dedent` SELECT * FROM client, @@ -90,8 +90,8 @@ describe("select FROM", () => { `); }); - it(`formats indexing modifiers`, () => { - test(dedent` + it(`formats indexing modifiers`, async () => { + await test(dedent` SELECT * FROM client INDEXED BY my_idx @@ -100,15 +100,15 @@ describe("select FROM", () => { }); describe("BigQuery", () => { - it(`formats UNNEST()`, () => { - testBigquery(dedent` + it(`formats UNNEST()`, async () => { + await testBigquery(dedent` SELECT * FROM UNNEST([10, 20, 30]) AS numbers WITH OFFSET `); }); - it(`formats PIVOT()`, () => { - testBigquery(dedent` + it(`formats PIVOT()`, async () => { + await testBigquery(dedent` SELECT * FROM Produce @@ -116,8 +116,8 @@ describe("select FROM", () => { `); }); - it(`formats long PIVOT() to multiple lines`, () => { - testBigquery(dedent` + it(`formats long PIVOT() to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM Produce @@ -129,8 +129,8 @@ describe("select FROM", () => { `); }); - it(`formats UNPIVOT()`, () => { - testBigquery(dedent` + it(`formats UNPIVOT()`, async () => { + await testBigquery(dedent` SELECT * FROM Produce @@ -138,8 +138,8 @@ describe("select FROM", () => { `); }); - it(`formats long UNPIVOT() with null-handling options to multiple lines`, () => { - testBigquery(dedent` + it(`formats long UNPIVOT() with null-handling options to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM Produce @@ -151,14 +151,14 @@ describe("select FROM", () => { `); }); - it(`formats TABLESPAMPLE operator`, () => { - testBigquery(dedent` + it(`formats TABLESPAMPLE operator`, async () => { + await testBigquery(dedent` SELECT * FROM dataset.my_table TABLESAMPLE SYSTEM (10 PERCENT) `); }); - it(`formats TABLESPAMPLE operator to multiple lines`, () => { - testBigquery(dedent` + it(`formats TABLESPAMPLE operator to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM myLongProjectName.myCustomDatasetName.my_table_name @@ -166,15 +166,15 @@ describe("select FROM", () => { `); }); - it(`formats FOR SYSTEM_TIME AS OF`, () => { - testBigquery(dedent` + it(`formats FOR SYSTEM_TIME AS OF`, async () => { + await testBigquery(dedent` SELECT * FROM tbl FOR SYSTEM_TIME AS OF '2017-01-01 10:00:00-07:00' `); }); - it(`formats long FOR SYSTEM_TIME AS OF to multiple lines`, () => { - testBigquery(dedent` + it(`formats long FOR SYSTEM_TIME AS OF to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM my_favorite_table AS fancy_table_name diff --git a/test/select/select.test.ts b/test/select/select.test.ts index bc097c0..bda413d 100644 --- a/test/select/select.test.ts +++ b/test/select/select.test.ts @@ -2,20 +2,20 @@ import dedent from "dedent-js"; import { pretty, test, testBigquery } from "../test_utils"; describe("select", () => { - it(`formats short SELECT..FROM..WHERE on single line`, () => { - test(`SELECT a, b, c FROM tbl WHERE x > y`); + it(`formats short SELECT..FROM..WHERE on single line`, async () => { + await test(`SELECT a, b, c FROM tbl WHERE x > y`); }); - it(`forces multi-line format when the original select is already multi-line`, () => { - expect(pretty(`SELECT a, b, c \n FROM tbl WHERE x > y`)).toBe(dedent` + it(`forces multi-line format when the original select is already multi-line`, async () => { + expect(await pretty(`SELECT a, b, c \n FROM tbl WHERE x > y`)).toBe(dedent` SELECT a, b, c FROM tbl WHERE x > y `); }); - it(`formats each SELECT clause to separate line`, () => { - test(dedent` + it(`formats each SELECT clause to separate line`, async () => { + await test(dedent` SELECT * FROM tbl WHERE x > y @@ -26,9 +26,9 @@ describe("select", () => { `); }); - it(`formats each SELECT clause with indented body when it doesn't fit on a single line`, () => { + it(`formats each SELECT clause with indented body when it doesn't fit on a single line`, async () => { expect( - pretty( + await pretty( `SELECT very_long_col_name, another_long_col_name FROM my_super_long_table_name WHERE my_table_name.x > my_table_name.y @@ -60,8 +60,8 @@ describe("select", () => { `); }); - it(`preserves multiline SELECT columns (even if they would fit on a single line)`, () => { - test(dedent` + it(`preserves multiline SELECT columns (even if they would fit on a single line)`, async () => { + await test(dedent` SELECT col1, col2, @@ -69,12 +69,12 @@ describe("select", () => { `); }); - it(`formats SELECT *`, () => { - test(`SELECT *`); + it(`formats SELECT *`, async () => { + await test(`SELECT *`); }); - it(`formats SELECT DISTINCT`, () => { - test( + it(`formats SELECT DISTINCT`, async () => { + await test( dedent` SELECT DISTINCT col1, @@ -86,12 +86,12 @@ describe("select", () => { ); }); - it(`formats LIMIT with just count`, () => { - test(`SELECT * FROM tbl LIMIT 10`); + it(`formats LIMIT with just count`, async () => { + await test(`SELECT * FROM tbl LIMIT 10`); }); - it(`formats set operations of select statements`, () => { - test(dedent` + it(`formats set operations of select statements`, async () => { + await test(dedent` SELECT * FROM client WHERE status = 'inactive' UNION ALL SELECT * FROM disabled_client @@ -101,15 +101,15 @@ describe("select", () => { }); describe("BigQuery", () => { - it(`removes trailing commas from SELECT`, () => { - expect(pretty(`SELECT 1, 2, 3,`, { dialect: "bigquery" })).toBe( + it(`removes trailing commas from SELECT`, async () => { + expect(await pretty(`SELECT 1, 2, 3,`, { dialect: "bigquery" })).toBe( `SELECT 1, 2, 3` ); }); - it(`removes trailing commas from multiline SELECT`, () => { + it(`removes trailing commas from multiline SELECT`, async () => { expect( - pretty( + await pretty( dedent` SELECT 'something long', @@ -132,28 +132,28 @@ describe("select", () => { ); }); - it(`formats SELECT * EXCEPT`, () => { - testBigquery(`SELECT * EXCEPT (order_id) FROM orders`); + it(`formats SELECT * EXCEPT`, async () => { + await testBigquery(`SELECT * EXCEPT (order_id) FROM orders`); }); - it(`formats SELECT * REPLACE`, () => { - testBigquery(`SELECT * REPLACE (order_id AS id) FROM orders`); + it(`formats SELECT * REPLACE`, async () => { + await testBigquery(`SELECT * REPLACE (order_id AS id) FROM orders`); }); - it(`formats SELECT AS STRUCT`, () => { - testBigquery(`SELECT AS STRUCT 1 AS a, 2 AS b`); + it(`formats SELECT AS STRUCT`, async () => { + await testBigquery(`SELECT AS STRUCT 1 AS a, 2 AS b`); }); - it(`formats SELECT AS VALUE`, () => { - testBigquery(`SELECT AS VALUE foo()`); + it(`formats SELECT AS VALUE`, async () => { + await testBigquery(`SELECT AS VALUE foo()`); }); - it(`formats GROUP BY ROLLUP()`, () => { - testBigquery(`SELECT * FROM tbl GROUP BY ROLLUP(a, b, c)`); + it(`formats GROUP BY ROLLUP()`, async () => { + await testBigquery(`SELECT * FROM tbl GROUP BY ROLLUP(a, b, c)`); }); - it(`formats GROUP BY ROLLUP() to multiple lines`, () => { - testBigquery(dedent` + it(`formats GROUP BY ROLLUP() to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM my_table_name GROUP BY @@ -166,12 +166,12 @@ describe("select", () => { `); }); - it(`formats QUALIFY clause`, () => { - testBigquery(`SELECT * FROM tbl QUALIFY x > 10`); + it(`formats QUALIFY clause`, async () => { + await testBigquery(`SELECT * FROM tbl QUALIFY x > 10`); }); - it(`formats long QUALIFY clause to multiple lines`, () => { - testBigquery(dedent` + it(`formats long QUALIFY clause to multiple lines`, async () => { + await testBigquery(dedent` SELECT * FROM my_table_name QUALIFY diff --git a/test/select/window.test.ts b/test/select/window.test.ts index 74be8fb..1688bd3 100644 --- a/test/select/window.test.ts +++ b/test/select/window.test.ts @@ -2,16 +2,16 @@ import dedent from "dedent-js"; import { test } from "../test_utils"; describe("select", () => { - it(`formats short window clause on single lines`, () => { - test(dedent` + it(`formats short window clause on single lines`, async () => { + await test(dedent` SELECT * FROM tbl WINDOW my_win AS (PARTITION BY col1) `); }); - it(`formats multiple window definitions on separate lines`, () => { - test(dedent` + it(`formats multiple window definitions on separate lines`, async () => { + await test(dedent` SELECT * FROM tbl WINDOW @@ -20,8 +20,8 @@ describe("select", () => { `); }); - it(`formats long window definitions on multiple lines`, () => { - test(dedent` + it(`formats long window definitions on multiple lines`, async () => { + await test(dedent` SELECT * FROM tbl WINDOW @@ -42,23 +42,23 @@ describe("select", () => { `); }); - it("formats basic window function calls, referencing named window", () => { - test(dedent` + it("formats basic window function calls, referencing named window", async () => { + await test(dedent` SELECT row_number() OVER win1 FROM tbl WINDOW win1 AS (ORDER BY x) `); }); - it("formats short window function calls on single line", () => { - test(dedent` + it("formats short window function calls on single line", async () => { + await test(dedent` SELECT row_number() OVER (ORDER BY x) FROM tbl `); }); - it("formats longer window function calls on multiple lines", () => { - test(dedent` + it("formats longer window function calls on multiple lines", async () => { + await test(dedent` SELECT row_number() OVER ( PARTITION BY y @@ -68,15 +68,15 @@ describe("select", () => { `); }); - it("formats window function call with short FILTER clause on single line", () => { - test(dedent` + it("formats window function call with short FILTER clause on single line", async () => { + await test(dedent` SELECT row_number() FILTER (WHERE x > 10) OVER (ORDER BY x) FROM tbl `); }); - it("formats window function call with longer FILTER and OVER clauses on multiple lines", () => { - test(dedent` + it("formats window function call with longer FILTER and OVER clauses on multiple lines", async () => { + await test(dedent` SELECT group_concat(entity_name, '.') FILTER (WHERE entity_type IS NOT NULL) diff --git a/test/select/with.test.ts b/test/select/with.test.ts index 149d54e..c298479 100644 --- a/test/select/with.test.ts +++ b/test/select/with.test.ts @@ -2,22 +2,22 @@ import dedent from "dedent-js"; import { test } from "../test_utils"; describe("select with", () => { - it(`formats tiny WITH on same line as the rest of SELECT`, () => { - test(dedent` + it(`formats tiny WITH on same line as the rest of SELECT`, async () => { + await test(dedent` WITH cte1 AS (SELECT * FROM client) SELECT * FROM cte1 `); }); - it(`formats short WITH clause on single line inside multiline SELECT`, () => { - test(dedent` + it(`formats short WITH clause on single line inside multiline SELECT`, async () => { + await test(dedent` WITH cte1 AS (SELECT * FROM client) SELECT * FROM cte1 `); }); - it(`formats long WITH clause on multiple lines`, () => { - test(dedent` + it(`formats long WITH clause on multiple lines`, async () => { + await test(dedent` WITH cte1 AS (SELECT * FROM client WHERE age > 100), cte2 AS (SELECT * FROM client WHERE age < 10) @@ -26,8 +26,8 @@ describe("select with", () => { `); }); - it(`formats WITH clause with various options`, () => { - test(dedent` + it(`formats WITH clause with various options`, async () => { + await test(dedent` WITH RECURSIVE cte1 AS MATERIALIZED (SELECT * FROM client WHERE age > 100), cte2 AS NOT MATERIALIZED (SELECT * FROM client WHERE age < 10) @@ -36,8 +36,8 @@ describe("select with", () => { `); }); - it(`formats SELECT inside CTE on multiple lines`, () => { - test(dedent` + it(`formats SELECT inside CTE on multiple lines`, async () => { + await test(dedent` WITH RECURSIVE cte1 AS ( SELECT * @@ -49,8 +49,8 @@ describe("select with", () => { `); }); - it(`formats CTE with column names list`, () => { - test(dedent` + it(`formats CTE with column names list`, async () => { + await test(dedent` WITH oldies(id, name) AS (SELECT * FROM client WHERE age > 100) SELECT * FROM oldies diff --git a/test/sqlite/attach_detach.test.ts b/test/sqlite/attach_detach.test.ts index 3a6f38f..ecd92d7 100644 --- a/test/sqlite/attach_detach.test.ts +++ b/test/sqlite/attach_detach.test.ts @@ -1,19 +1,19 @@ import { test } from "../test_utils"; describe("attach/detach", () => { - it(`formats ATTACH DATABASE statement`, () => { - test(`ATTACH DATABASE 'my_file.sqlite' AS my_schema`); + it(`formats ATTACH DATABASE statement`, async () => { + await test(`ATTACH DATABASE 'my_file.sqlite' AS my_schema`); }); - it(`formats plain ATTACH statement (without DATABASE keyword)`, () => { - test(`ATTACH 'my_file.sqlite' AS my_schema`); + it(`formats plain ATTACH statement (without DATABASE keyword)`, async () => { + await test(`ATTACH 'my_file.sqlite' AS my_schema`); }); - it(`formats DETACH DATABASE statement`, () => { - test(`DETACH DATABASE my_schema`); + it(`formats DETACH DATABASE statement`, async () => { + await test(`DETACH DATABASE my_schema`); }); - it(`formats plain DETACH statement (without DATABASE keyword)`, () => { - test(`DETACH my_schema`); + it(`formats plain DETACH statement (without DATABASE keyword)`, async () => { + await test(`DETACH my_schema`); }); }); diff --git a/test/sqlite/pragma.test.ts b/test/sqlite/pragma.test.ts index 4f79727..e33989e 100644 --- a/test/sqlite/pragma.test.ts +++ b/test/sqlite/pragma.test.ts @@ -1,15 +1,15 @@ import { test } from "../test_utils"; describe("pragma", () => { - it(`formats reading of PRAGMA value`, () => { - test(`PRAGMA function_list`); + it(`formats reading of PRAGMA value`, async () => { + await test(`PRAGMA function_list`); }); - it(`formats PRAGMA assignment`, () => { - test(`PRAGMA encoding = 'UTF-8'`); + it(`formats PRAGMA assignment`, async () => { + await test(`PRAGMA encoding = 'UTF-8'`); }); - it(`formats PRAGMA function call`, () => { - test(`PRAGMA my_schema.wal_checkpoint(PASSIVE)`); + it(`formats PRAGMA function call`, async () => { + await test(`PRAGMA my_schema.wal_checkpoint(PASSIVE)`); }); }); diff --git a/test/sqlite/reindex.test.ts b/test/sqlite/reindex.test.ts index 710459d..7d94af0 100644 --- a/test/sqlite/reindex.test.ts +++ b/test/sqlite/reindex.test.ts @@ -1,11 +1,11 @@ import { test } from "../test_utils"; describe("reindex", () => { - it(`formats REINDEX`, () => { - test(`REINDEX my_schema.my_table`); + it(`formats REINDEX`, async () => { + await test(`REINDEX my_schema.my_table`); }); - it(`formats plain REINDEX`, () => { - test(`REINDEX`); + it(`formats plain REINDEX`, async () => { + await test(`REINDEX`); }); }); diff --git a/test/sqlite/vacuum.test.ts b/test/sqlite/vacuum.test.ts index 83cc9d2..fbd2c03 100644 --- a/test/sqlite/vacuum.test.ts +++ b/test/sqlite/vacuum.test.ts @@ -1,19 +1,19 @@ import { test } from "../test_utils"; describe("vacuum", () => { - it(`formats VACUUM schema INTO file`, () => { - test(`VACUUM my_schema INTO 'my_file.sqlite'`); + it(`formats VACUUM schema INTO file`, async () => { + await test(`VACUUM my_schema INTO 'my_file.sqlite'`); }); - it(`formats plain VACUUM statement`, () => { - test(`VACUUM`); + it(`formats plain VACUUM statement`, async () => { + await test(`VACUUM`); }); - it(`formats VACUUM with just schema`, () => { - test(`VACUUM my_schema`); + it(`formats VACUUM with just schema`, async () => { + await test(`VACUUM my_schema`); }); - it(`formats VACUUM with just INTO`, () => { - test(`VACUUM INTO 'my_file.sqlite'`); + it(`formats VACUUM with just INTO`, async () => { + await test(`VACUUM INTO 'my_file.sqlite'`); }); }); diff --git a/test/sqlite/virtual_table.test.ts b/test/sqlite/virtual_table.test.ts index 4553154..f4763bc 100644 --- a/test/sqlite/virtual_table.test.ts +++ b/test/sqlite/virtual_table.test.ts @@ -2,15 +2,15 @@ import dedent from "dedent-js"; import { test } from "../test_utils"; describe("create virtual table", () => { - it(`formats CREATE VIRTUAL TABLE`, () => { - test(dedent` + it(`formats CREATE VIRTUAL TABLE`, async () => { + await test(dedent` CREATE VIRTUAL TABLE my_table USING my_func(1, 2) `); }); - it(`formats IF NOT EXISTS`, () => { - test(dedent` + it(`formats IF NOT EXISTS`, async () => { + await test(dedent` CREATE VIRTUAL TABLE IF NOT EXISTS my_table USING my_func(1, 2) `); diff --git a/test/statement.test.ts b/test/statement.test.ts index 418786f..159aad0 100644 --- a/test/statement.test.ts +++ b/test/statement.test.ts @@ -4,22 +4,22 @@ import { rawPretty, rawTest } from "./test_utils"; // In these tests we use rawPretty() // to also test that formatted file always ends with final newline. describe("statement", () => { - it(`adds semicolon to statement without a semicolon`, () => { - expect(rawPretty(`SELECT 1`)).toBe(dedent` + it(`adds semicolon to statement without a semicolon`, async () => { + expect(await rawPretty(`SELECT 1`)).toBe(dedent` SELECT 1; `); }); - it(`formats statement ending with semicolon`, () => { - expect(rawPretty(`SELECT 1;`)).toBe(dedent` + it(`formats statement ending with semicolon`, async () => { + expect(await rawPretty(`SELECT 1;`)).toBe(dedent` SELECT 1; `); }); - it(`formats multiple statements`, () => { - expect(rawPretty(`SELECT 1; SELECT 2; SELECT 3;`)).toBe(dedent` + it(`formats multiple statements`, async () => { + expect(await rawPretty(`SELECT 1; SELECT 2; SELECT 3;`)).toBe(dedent` SELECT 1; SELECT 2; SELECT 3; @@ -27,8 +27,8 @@ describe("statement", () => { `); }); - it(`ensures semicolon after last statement`, () => { - expect(rawPretty(`SELECT 1; SELECT 2; SELECT 3`)).toBe(dedent` + it(`ensures semicolon after last statement`, async () => { + expect(await rawPretty(`SELECT 1; SELECT 2; SELECT 3`)).toBe(dedent` SELECT 1; SELECT 2; SELECT 3; @@ -36,7 +36,7 @@ describe("statement", () => { `); }); - it(`preserves empty line between statements`, () => { + it(`preserves empty line between statements`, async () => { rawTest(dedent` SELECT 1; @@ -49,9 +49,9 @@ describe("statement", () => { `); }); - it(`replaces multiple empty lines with just one`, () => { + it(`replaces multiple empty lines with just one`, async () => { expect( - rawPretty(dedent` + await rawPretty(dedent` SELECT 1; diff --git a/test/test_utils.ts b/test/test_utils.ts index 052f16a..cce5616 100644 --- a/test/test_utils.ts +++ b/test/test_utils.ts @@ -11,7 +11,7 @@ interface TestOptions extends PrettyOptions { dialect?: DialectName; } -export const rawPretty = (sql: string, opts: TestOptions = {}): string => { +export const rawPretty = async (sql: string, opts: TestOptions = {}): Promise => { return format(sql, { parser: opts.dialect ?? "sqlite", plugins: [plugin], @@ -19,8 +19,8 @@ export const rawPretty = (sql: string, opts: TestOptions = {}): string => { }); }; -export const pretty = (sql: string, opts: TestOptions = {}): string => { - const formatted = rawPretty(sql, opts); +export const pretty = async (sql: string, opts: TestOptions = {}): Promise => { + const formatted = await rawPretty(sql, opts); if (!/;\n$/.test(formatted)) { throw new Error( `Expected semicolon and newline at the end of:\n${formatted}` @@ -29,14 +29,14 @@ export const pretty = (sql: string, opts: TestOptions = {}): string => { return formatted.replace(/;\n$/, ""); }; -export const rawTest = (sql: string, opts: TestOptions = {}): void => { - expect(rawPretty(sql, opts)).toBe(sql); +export const rawTest = async (sql: string, opts: TestOptions = {}): Promise => { + expect(await rawPretty(sql, opts)).toBe(sql); }; -export const test = (sql: string, opts: TestOptions = {}): void => { - expect(pretty(sql, opts)).toBe(sql); +export const test = async (sql: string, opts: TestOptions = {}): Promise => { + expect(await pretty(sql, opts)).toBe(sql); }; -export const testBigquery = (sql: string, opts: TestOptions = {}): void => { - test(sql, { dialect: "bigquery", ...opts }); +export const testBigquery = async (sql: string, opts: TestOptions = {}): Promise => { + await await test(sql, { dialect: "bigquery", ...opts }); }; diff --git a/test/transaction.test.ts b/test/transaction.test.ts index 895a5ed..e2d5bec 100644 --- a/test/transaction.test.ts +++ b/test/transaction.test.ts @@ -2,7 +2,7 @@ import dedent from "dedent-js"; import { rawTest } from "./test_utils"; describe("transaction", () => { - it(`formats basic BEGIN..COMMIT`, () => { + it(`formats basic BEGIN..COMMIT`, async () => { rawTest(dedent` BEGIN; @@ -13,7 +13,7 @@ describe("transaction", () => { `); }); - it(`formats basic BEGIN..END`, () => { + it(`formats basic BEGIN..END`, async () => { rawTest(dedent` BEGIN; @@ -24,7 +24,7 @@ describe("transaction", () => { `); }); - it(`formats BEGIN TRANSACTION .. COMMIT TRANSACTION`, () => { + it(`formats BEGIN TRANSACTION .. COMMIT TRANSACTION`, async () => { rawTest(dedent` BEGIN TRANSACTION; @@ -35,14 +35,14 @@ describe("transaction", () => { `); }); - it(`formats BEGIN DEFERRED TRANSACTION`, () => { + it(`formats BEGIN DEFERRED TRANSACTION`, async () => { rawTest(dedent` BEGIN DEFERRED TRANSACTION; `); }); - it(`formats ROLLBACK`, () => { + it(`formats ROLLBACK`, async () => { rawTest(dedent` ROLLBACK; @@ -55,14 +55,14 @@ describe("transaction", () => { `); }); - it(`formats SAVEPOINT`, () => { + it(`formats SAVEPOINT`, async () => { rawTest(dedent` SAVEPOINT my_savepoint; `); }); - it(`formats RELEASE SAVEPOINT`, () => { + it(`formats RELEASE SAVEPOINT`, async () => { rawTest(dedent` RELEASE my_savepoint; diff --git a/yarn.lock b/yarn.lock index ec63824..da769d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -268,7 +268,7 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7": version "7.20.12" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.12.tgz#7f0f787b3a67ca4475adef1f56cb94f6abd4a4b5" integrity sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ== @@ -314,61 +314,61 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" - integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.7.0.tgz#cd4822dbdb84529265c5a2bdb529a3c9cc950ffc" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.3.1" - jest-util "^29.3.1" + jest-message-util "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" -"@jest/core@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" - integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== +"@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.7.0.tgz#b6cccc239f30ff36609658c5a5e2291757ce448f" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== dependencies: - "@jest/console" "^29.3.1" - "@jest/reporters" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.2.0" - jest-config "^29.3.1" - jest-haste-map "^29.3.1" - jest-message-util "^29.3.1" - jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-resolve-dependencies "^29.3.1" - jest-runner "^29.3.1" - jest-runtime "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" - jest-watcher "^29.3.1" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" micromatch "^4.0.4" - pretty-format "^29.3.1" + pretty-format "^29.7.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" - integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== dependencies: - "@jest/fake-timers" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.3.1" + jest-mock "^29.7.0" "@jest/expect-utils@^29.3.1": version "29.3.1" @@ -377,47 +377,54 @@ dependencies: jest-get-type "^29.2.0" -"@jest/expect@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" - integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== dependencies: - expect "^29.3.1" - jest-snapshot "^29.3.1" + jest-get-type "^29.6.3" -"@jest/fake-timers@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" - integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.7.0.tgz#76a3edb0cb753b70dfbfe23283510d3d45432bf2" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== dependencies: - "@jest/types" "^29.3.1" - "@sinonjs/fake-timers" "^9.1.2" + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.3.1" - jest-mock "^29.3.1" - jest-util "^29.3.1" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" -"@jest/globals@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" - integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.7.0.tgz#8d9290f9ec47ff772607fa864ca1d5a2efae1d4d" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== dependencies: - "@jest/environment" "^29.3.1" - "@jest/expect" "^29.3.1" - "@jest/types" "^29.3.1" - jest-mock "^29.3.1" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" -"@jest/reporters@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" - integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.7.0.tgz#04b262ecb3b8faa83b0b3d321623972393e8f4c7" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" - "@jridgewell/trace-mapping" "^0.3.15" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -425,13 +432,13 @@ glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" + istanbul-lib-instrument "^6.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.3.1" - jest-util "^29.3.1" - jest-worker "^29.3.1" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -444,55 +451,62 @@ dependencies: "@sinclair/typebox" "^0.24.1" -"@jest/source-map@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" - integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ== +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: - "@jridgewell/trace-mapping" "^0.3.15" + "@sinclair/typebox" "^0.27.8" + +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" - integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.7.0.tgz#8db9a80aa1a097bb2262572686734baed9b1657c" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== dependencies: - "@jest/console" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" - integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz#6cef977ce1d39834a3aea887a1726628a6f072ce" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== dependencies: - "@jest/test-result" "^29.3.1" + "@jest/test-result" "^29.7.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" + jest-haste-map "^29.7.0" slash "^3.0.0" -"@jest/transform@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" - integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.7.0.tgz#df2dd9c346c7d7768b8a06639994640c642e284c" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.3.1" - "@jridgewell/trace-mapping" "^0.3.15" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" - jest-regex-util "^29.2.0" - jest-util "^29.3.1" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" - write-file-atomic "^4.0.1" + write-file-atomic "^4.0.2" "@jest/types@^29.3.1": version "29.3.1" @@ -506,6 +520,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -528,6 +554,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" @@ -538,7 +569,12 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -546,24 +582,37 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@jridgewell/trace-mapping@^0.3.18": + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== -"@sinonjs/commons@^1.7.0": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" - integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + +"@sinonjs/commons@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.0.tgz#beb434fe875d965265e04722ccfc21df7f755d72" + integrity sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA== dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^9.1.2": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" - integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: - "@sinonjs/commons" "^1.7.0" + "@sinonjs/commons" "^3.0.0" "@types/babel__core@^7.1.14": version "7.1.20" @@ -637,11 +686,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== -"@types/prettier@^2.1.5": - version "2.7.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" - integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== - "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -705,15 +749,15 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -babel-jest@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" - integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== +babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== dependencies: - "@jest/transform" "^29.3.1" + "@jest/transform" "^29.7.0" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.2.0" + babel-preset-jest "^29.6.3" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -729,10 +773,10 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094" - integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA== +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz#aadbe943464182a8922c3c927c3067ff40d24626" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -757,12 +801,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc" - integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA== +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz#fa05fa510e7d493896d7b0dd2033601c840f171c" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== dependencies: - babel-plugin-jest-hoist "^29.2.0" + babel-plugin-jest-hoist "^29.6.3" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -924,6 +968,19 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -945,10 +1002,10 @@ dedent-js@^1.0.1: resolved "https://registry.yarnpkg.com/dedent-js/-/dedent-js-1.0.1.tgz#bee5fb7c9e727d85dffa24590d10ec1ab1255305" integrity sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ== -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +dedent@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== deepmerge@^4.2.2: version "4.2.2" @@ -965,6 +1022,11 @@ diff-sequences@^29.3.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + electron-to-chromium@^1.4.251: version "1.4.284" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" @@ -1027,7 +1089,7 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== -expect@^29.0.0, expect@^29.3.1: +expect@^29.0.0: version "29.3.1" resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== @@ -1038,6 +1100,17 @@ expect@^29.0.0, expect@^29.3.1: jest-message-util "^29.3.1" jest-util "^29.3.1" +expect@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -1217,7 +1290,7 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: +istanbul-lib-instrument@^5.0.4: version "5.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== @@ -1228,6 +1301,17 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz#71e87707e8041428732518c6fb5211761753fbdf" + integrity sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -1254,82 +1338,83 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289" - integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA== +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== dependencies: execa "^5.0.0" + jest-util "^29.7.0" p-limit "^3.1.0" -jest-circus@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" - integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.7.0.tgz#b6817a45fcc835d8b16d5962d0c026473ee3668a" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== dependencies: - "@jest/environment" "^29.3.1" - "@jest/expect" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - dedent "^0.7.0" + dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.3.1" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-runtime "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" p-limit "^3.1.0" - pretty-format "^29.3.1" + pretty-format "^29.7.0" + pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" - integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== +jest-cli@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.7.0.tgz#5592c940798e0cae677eec169264f2d839a37995" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== dependencies: - "@jest/core" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" chalk "^4.0.0" + create-jest "^29.7.0" exit "^0.1.2" - graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" - prompts "^2.0.1" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" yargs "^17.3.1" -jest-config@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" - integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.7.0.tgz#bcbda8806dbcc01b1e316a46bb74085a84b0245f" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.3.1" - "@jest/types" "^29.3.1" - babel-jest "^29.3.1" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.3.1" - jest-environment-node "^29.3.1" - jest-get-type "^29.2.0" - jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-runner "^29.3.1" - jest-util "^29.3.1" - jest-validate "^29.3.1" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.3.1" + pretty-format "^29.7.0" slash "^3.0.0" strip-json-comments "^3.1.1" @@ -1343,67 +1428,82 @@ jest-diff@^29.3.1: jest-get-type "^29.2.0" pretty-format "^29.3.1" -jest-docblock@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82" - integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A== +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== dependencies: - detect-newline "^3.0.0" + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" -jest-each@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" - integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.7.0.tgz#8fddb6adc3cdc955c93e2a87f61cfd350d5d119a" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== dependencies: - "@jest/types" "^29.3.1" - chalk "^4.0.0" - jest-get-type "^29.2.0" - jest-util "^29.3.1" - pretty-format "^29.3.1" + detect-newline "^3.0.0" -jest-environment-node@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" - integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.7.0.tgz#162a9b3f2328bdd991beaabffbb74745e56577d1" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== dependencies: - "@jest/environment" "^29.3.1" - "@jest/fake-timers" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.3.1" - jest-util "^29.3.1" + jest-mock "^29.7.0" + jest-util "^29.7.0" jest-get-type@^29.2.0: version "29.2.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== -jest-haste-map@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" - integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.7.0.tgz#3c2396524482f5a0506376e6c858c3bbcc17b104" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^29.2.0" - jest-util "^29.3.1" - jest-worker "^29.3.1" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" - integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== dependencies: - jest-get-type "^29.2.0" - pretty-format "^29.3.1" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" jest-matcher-utils@^29.3.1: version "29.3.1" @@ -1415,6 +1515,16 @@ jest-matcher-utils@^29.3.1: jest-get-type "^29.2.0" pretty-format "^29.3.1" +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + jest-message-util@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" @@ -1430,132 +1540,143 @@ jest-message-util@^29.3.1: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" - integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== dependencies: - "@jest/types" "^29.3.1" + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.3.1" + jest-util "^29.7.0" jest-pnp-resolver@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== -jest-regex-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" - integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" - integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz#1b04f2c095f37fc776ff40803dc92921b1e88428" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== dependencies: - jest-regex-util "^29.2.0" - jest-snapshot "^29.3.1" + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" -jest-resolve@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" - integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== +jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.7.0.tgz#64d6a8992dd26f635ab0c01e5eef4399c6bcbc30" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" + jest-haste-map "^29.7.0" jest-pnp-resolver "^1.2.2" - jest-util "^29.3.1" - jest-validate "^29.3.1" + jest-util "^29.7.0" + jest-validate "^29.7.0" resolve "^1.20.0" - resolve.exports "^1.1.0" + resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" - integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.7.0.tgz#809af072d408a53dcfd2e849a4c976d3132f718e" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== dependencies: - "@jest/console" "^29.3.1" - "@jest/environment" "^29.3.1" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.2.0" - jest-environment-node "^29.3.1" - jest-haste-map "^29.3.1" - jest-leak-detector "^29.3.1" - jest-message-util "^29.3.1" - jest-resolve "^29.3.1" - jest-runtime "^29.3.1" - jest-util "^29.3.1" - jest-watcher "^29.3.1" - jest-worker "^29.3.1" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" - integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== - dependencies: - "@jest/environment" "^29.3.1" - "@jest/fake-timers" "^29.3.1" - "@jest/globals" "^29.3.1" - "@jest/source-map" "^29.2.0" - "@jest/test-result" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.7.0.tgz#efecb3141cf7d3767a3a0cc8f7c9990587d3d817" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.3.1" - jest-message-util "^29.3.1" - jest-mock "^29.3.1" - jest-regex-util "^29.2.0" - jest-resolve "^29.3.1" - jest-snapshot "^29.3.1" - jest-util "^29.3.1" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" - integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.3.1" - "@jest/transform" "^29.3.1" - "@jest/types" "^29.3.1" - "@types/babel__traverse" "^7.0.6" - "@types/prettier" "^2.1.5" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.3.1" + expect "^29.7.0" graceful-fs "^4.2.9" - jest-diff "^29.3.1" - jest-get-type "^29.2.0" - jest-haste-map "^29.3.1" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-util "^29.3.1" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" natural-compare "^1.4.0" - pretty-format "^29.3.1" - semver "^7.3.5" + pretty-format "^29.7.0" + semver "^7.5.3" jest-util@^29.0.0, jest-util@^29.3.1: version "29.3.1" @@ -1569,51 +1690,63 @@ jest-util@^29.0.0, jest-util@^29.3.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" - integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== +jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== dependencies: - "@jest/types" "^29.3.1" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.7.0.tgz#7bf705511c64da591d46b15fce41400d52147d9c" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.2.0" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.3.1" + pretty-format "^29.7.0" -jest-watcher@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" - integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.7.0.tgz#7810d30d619c3a62093223ce6bb359ca1b28a2f2" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== dependencies: - "@jest/test-result" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.3.1" + jest-util "^29.7.0" string-length "^4.0.1" -jest-worker@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" - integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.7.0.tgz#acad073acbbaeb7262bd5389e1bcf43e10058d4a" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== dependencies: "@types/node" "*" - jest-util "^29.3.1" + jest-util "^29.7.0" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122" - integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== +jest@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" + integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== dependencies: - "@jest/core" "^29.3.1" - "@jest/types" "^29.3.1" + "@jest/core" "^29.7.0" + "@jest/types" "^29.6.3" import-local "^3.0.2" - jest-cli "^29.3.1" + jest-cli "^29.7.0" js-tokens@^4.0.0: version "4.0.0" @@ -1638,7 +1771,7 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json5@^2.2.1, json5@^2.2.2: +json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -1852,10 +1985,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -prettier@^2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160" - integrity sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw== +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== pretty-format@^29.0.0, pretty-format@^29.3.1: version "29.3.1" @@ -1866,6 +1999,15 @@ pretty-format@^29.0.0, pretty-format@^29.3.1: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -1874,6 +2016,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +pure-rand@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.4.tgz#50b737f6a925468679bff00ad20eade53f37d5c7" + integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== + react-is@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" @@ -1896,10 +2043,10 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve.exports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" - integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== +resolve.exports@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== resolve@^1.20.0: version "1.22.1" @@ -1910,18 +2057,18 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -semver@7.x, semver@^7.3.5: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== - dependencies: - lru-cache "^6.0.0" - semver@^6.0.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2070,18 +2217,18 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -ts-jest@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.0.3.tgz#63ea93c5401ab73595440733cefdba31fcf9cb77" - integrity sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ== +ts-jest@^29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" jest-util "^29.0.0" - json5 "^2.2.1" + json5 "^2.2.3" lodash.memoize "4.x" make-error "1.x" - semver "7.x" + semver "^7.5.3" yargs-parser "^21.0.1" type-detect@4.0.8: @@ -2144,7 +2291,7 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -write-file-atomic@^4.0.1: +write-file-atomic@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==