Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade #70

Merged
merged 6 commits into from
Mar 3, 2024
Merged

Upgrade #70

merged 6 commits into from
Mar 3, 2024

Conversation

JacobLinCool
Copy link
Owner

Refactor code and drop dependency on Node built-in module.

Copy link

changeset-bot bot commented Mar 3, 2024

🦋 Changeset detected

Latest commit: ffba702

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
leetcode-query Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Mar 3, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🟢 Statements
100% (+18.15% 🔼)
0/0
🟢 Branches
100% (+41.67% 🔼)
0/0
🟢 Functions
100% (+13.56% 🔼)
0/0
🟢 Lines
100% (+17.9% 🔼)
0/0

Test suite run failed

Failed tests: 0/0. Failed suites: 7/7.
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/cache.test.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { describe, expect, it } from "vitest";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (../../../.npm/_npx/b8d86e6551a4f492/node_modules/jest-runtime/build/index.js:1505:14)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/leetcode-cn.test.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { describe, expect, it } from "vitest";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (../../../.npm/_npx/b8d86e6551a4f492/node_modules/jest-runtime/build/index.js:1505:14)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    SyntaxError: /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/leetcode.test.ts: Missing semicolon. (87:14)

      85 |         dotenv.config();
      86 |         const credential = new Credential();
    > 87 |         let lc: LeetCode;
         |               ^
      88 |
      89 |         beforeAll(async () => {
      90 |             await credential.init(process.env["TEST_LEETCODE_SESSION"]);

      at constructor (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parse-error.ts:74:19)
      at Parser.toParseError [as raise] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/tokenizer/index.ts:1487:19)
      at Parser.raise [as semicolon] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/util.ts:141:10)
      at Parser.semicolon [as parseVarStatement] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1194:10)
      at Parser.parseVarStatement [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:546:21)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseStatementListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:366:17)
      at Parser.parseStatementListItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1386:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseBlock] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1327:10)
      at Parser.parseBlock [as parseFunctionBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2572:24)
      at Parser.parseFunctionBody [as parseArrowExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2515:10)
      at Parser.parseArrowExpression [as parseParenAndDistinguishExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1818:12)
      at Parser.parseParenAndDistinguishExpression [as parseExprAtom] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1159:21)
      at Parser.parseExprAtom [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:703:23)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at parseMaybeAssign (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:246:12)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3112:12)
      at Parser.allowInAnd [as parseMaybeAssignAllowIn] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:245:17)
      at Parser.parseMaybeAssignAllowIn [as parseExprListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2735:18)
      at Parser.parseExprListItem [as parseCallExpressionArguments] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1035:14)
      at Parser.parseCallExpressionArguments [as parseCoverCallAndAsyncArrowHead] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:877:29)
      at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:766:19)
      at Parser.parseSubscript [as parseSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:724:19)
      at Parser.parseSubscripts [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:709:17)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at Parser.parseMaybeAssign [as parseExpressionBase] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:215:23)
      at parseExpressionBase (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:39)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3107:16)
      at Parser.allowInAnd [as parseExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:17)
      at Parser.parseExpression [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:636:23)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseStatementListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:366:17)
      at Parser.parseStatementListItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1386:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseBlock] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1327:10)
      at Parser.parseBlock [as parseFunctionBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2572:24)
      at Parser.parseFunctionBody [as parseArrowExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2515:10)
      at Parser.parseArrowExpression [as parseParenAndDistinguishExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1818:12)
      at Parser.parseParenAndDistinguishExpression [as parseExprAtom] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1159:21)
      at Parser.parseExprAtom [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:703:23)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at parseMaybeAssign (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:246:12)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3112:12)
      at Parser.allowInAnd [as parseMaybeAssignAllowIn] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:245:17)
      at Parser.parseMaybeAssignAllowIn [as parseExprListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2735:18)
      at Parser.parseExprListItem [as parseCallExpressionArguments] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1035:14)
      at Parser.parseCallExpressionArguments [as parseCoverCallAndAsyncArrowHead] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:877:29)
      at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:766:19)
      at Parser.parseSubscript [as parseSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:724:19)
      at Parser.parseSubscripts [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:709:17)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at Parser.parseMaybeAssign [as parseExpressionBase] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:215:23)
      at parseExpressionBase (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:39)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3107:16)
      at Parser.allowInAnd [as parseExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:17)
      at Parser.parseExpression [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:636:23)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseModuleItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:354:17)
      at Parser.parseModuleItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1385:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseProgram] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:213:10)
      at Parser.parseProgram [as parseTopLevel] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:195:25)
      at Parser.parseTopLevel [as parse] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/index.ts:45:10)
      at parse (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/index.ts:66:38)
      at parser (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/parser/index.ts:28:19)
          at parser.next (<anonymous>)
      at normalizeFile (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transformation/normalize-file.ts:50:24)
          at normalizeFile.next (<anonymous>)
      at run (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transformation/index.ts:39:36)
          at run.next (<anonymous>)
      at transform (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transform.ts:29:20)
          at transform.next (<anonymous>)
      at evaluateSync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/gensync/index.js:251:28)
      at sync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/gensync/index.js:89:14)
      at fn (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/errors/rewrite-stack-trace.ts:99:14)
      at transformSync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transform.ts:66:52)
      at ScriptTransformer.transformSource (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@jest/transform/build/ScriptTransformer.js:545:31)
      at ScriptTransformer._transformAndBuildScript (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@jest/transform/build/ScriptTransformer.js:674:40)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/credential.test.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { describe, expect, it } from "vitest";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (../../../.npm/_npx/b8d86e6551a4f492/node_modules/jest-runtime/build/index.js:1505:14)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    SyntaxError: /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/mutex.test.ts: Missing initializer in const declaration. (14:21)

      12 |         const mutex = new Mutex();
      13 |
    > 14 |         const results: number[] = [];
         |                      ^
      15 |         for (let i = 0; i < 10; i++) {
      16 |             (async () => {
      17 |                 await mutex.lock();

      at constructor (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parse-error.ts:74:19)
      at Parser.toParseError [as raise] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/tokenizer/index.ts:1487:19)
      at Parser.raise [as parseVar] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1547:16)
      at Parser.parseVar [as parseVarStatement] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1193:10)
      at Parser.parseVarStatement [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:546:21)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseStatementListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:366:17)
      at Parser.parseStatementListItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1386:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseBlock] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1327:10)
      at Parser.parseBlock [as parseFunctionBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2572:24)
      at Parser.parseFunctionBody [as parseArrowExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2515:10)
      at Parser.parseArrowExpression [as parseAsyncArrowFromCallExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1055:10)
      at Parser.parseAsyncArrowFromCallExpression [as parseCoverCallAndAsyncArrowHead] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:900:27)
      at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:766:19)
      at Parser.parseSubscript [as parseSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:724:19)
      at Parser.parseSubscripts [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:709:17)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at parseMaybeAssign (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:246:12)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3112:12)
      at Parser.allowInAnd [as parseMaybeAssignAllowIn] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:245:17)
      at Parser.parseMaybeAssignAllowIn [as parseExprListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2735:18)
      at Parser.parseExprListItem [as parseCallExpressionArguments] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1035:14)
      at Parser.parseCallExpressionArguments [as parseCoverCallAndAsyncArrowHead] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:877:29)
      at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:766:19)
      at Parser.parseSubscript [as parseSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:724:19)
      at Parser.parseSubscripts [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:709:17)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at Parser.parseMaybeAssign [as parseExpressionBase] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:215:23)
      at parseExpressionBase (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:39)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3107:16)
      at Parser.allowInAnd [as parseExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:17)
      at Parser.parseExpression [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:636:23)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseStatementListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:366:17)
      at Parser.parseStatementListItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1386:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseBlock] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1327:10)
      at Parser.parseBlock [as parseFunctionBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2572:24)
      at Parser.parseFunctionBody [as parseArrowExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2515:10)
      at Parser.parseArrowExpression [as parseParenAndDistinguishExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1818:12)
      at Parser.parseParenAndDistinguishExpression [as parseExprAtom] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1159:21)
      at Parser.parseExprAtom [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:703:23)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at parseMaybeAssign (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:246:12)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3112:12)
      at Parser.allowInAnd [as parseMaybeAssignAllowIn] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:245:17)
      at Parser.parseMaybeAssignAllowIn [as parseExprListItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:2735:18)
      at Parser.parseExprListItem [as parseCallExpressionArguments] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:1035:14)
      at Parser.parseCallExpressionArguments [as parseCoverCallAndAsyncArrowHead] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:877:29)
      at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:766:19)
      at Parser.parseSubscript [as parseSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:724:19)
      at Parser.parseSubscripts [as parseExprSubscripts] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:709:17)
      at Parser.parseExprSubscripts [as parseUpdate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:680:21)
      at Parser.parseUpdate [as parseMaybeUnary] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:642:23)
      at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:385:14)
      at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:397:23)
      at Parser.parseExprOps [as parseMaybeConditional] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:352:23)
      at Parser.parseMaybeConditional [as parseMaybeAssign] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:292:21)
      at Parser.parseMaybeAssign [as parseExpressionBase] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:215:23)
      at parseExpressionBase (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:39)
      at Parser.callback [as allowInAnd] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:3107:16)
      at Parser.allowInAnd [as parseExpression] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/expression.ts:206:17)
      at Parser.parseExpression [as parseStatementContent] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:636:23)
      at Parser.parseStatementContent [as parseStatementLike] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:417:17)
      at Parser.parseStatementLike [as parseModuleItem] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:354:17)
      at Parser.parseModuleItem [as parseBlockOrModuleBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1385:16)
      at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:1359:10)
      at Parser.parseBlockBody [as parseProgram] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:213:10)
      at Parser.parseProgram [as parseTopLevel] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/statement.ts:195:25)
      at Parser.parseTopLevel [as parse] (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/parser/index.ts:45:10)
      at parse (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/parser/src/index.ts:66:38)
      at parser (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/parser/index.ts:28:19)
          at parser.next (<anonymous>)
      at normalizeFile (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transformation/normalize-file.ts:50:24)
          at normalizeFile.next (<anonymous>)
      at run (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transformation/index.ts:39:36)
          at run.next (<anonymous>)
      at transform (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transform.ts:29:20)
          at transform.next (<anonymous>)
      at evaluateSync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/gensync/index.js:251:28)
      at sync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/gensync/index.js:89:14)
      at fn (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/errors/rewrite-stack-trace.ts:99:14)
      at transformSync (../../../.npm/_npx/b8d86e6551a4f492/node_modules/@babel/core/src/transform.ts:66:52)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/constants.test.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { describe, expect, it } from "vitest";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (../../../.npm/_npx/b8d86e6551a4f492/node_modules/jest-runtime/build/index.js:1505:14)


  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/LeetCode-Query/LeetCode-Query/src/_tests/utils.test.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { describe, expect, it } from "vitest";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at Runtime.createScriptFromCode (../../../.npm/_npx/b8d86e6551a4f492/node_modules/jest-runtime/build/index.js:1505:14)

Report generated by 🧪jest coverage report action from 96ed056

@JacobLinCool JacobLinCool merged commit 792a476 into main Mar 3, 2024
2 checks passed
@JacobLinCool JacobLinCool deleted the upgrade branch March 3, 2024 18:09
@github-actions github-actions bot mentioned this pull request Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant