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

Cannot run test for CRA application #140

Open
iverJisty opened this issue Jan 29, 2024 · 0 comments
Open

Cannot run test for CRA application #140

iverJisty opened this issue Jan 29, 2024 · 0 comments
Assignees

Comments

@iverJisty
Copy link

Description

In application that created by create-react-app, the test will never end.

Envirionment

  1. VSCode

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:47:11.635Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.6.11-surface-1

  1. Codium-ai

0.7.33

Configuration

In .codiumai.toml, I have following configuration

[tests]
framework = "Jest"
utility_library = "Testing Library"

[tests.javascript]
overrideTestRunScript = "npx react-scripts test --watchAll=false --detectOpenHandles --runTestsByPath TEST_FILEPATH"

Output in plugin

["DEBUG" - 2:20:24 PM] [RUN TESTS] [JS/TS] About to run test:
{
  "cmd": "npx react-scripts test =false --detectOpenHandles --runTestsByPath src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js --forceExit --coverage=false --testNamePattern \"should send a POST request to the logout endpoint\" --json",
  "cwd": "<My project root>"
}
["DEBUG" - 2:21:59 PM] [RUN TESTS] [JS/TS] Test run encountered an error. Raw results:
{
  "stdout": "{\"numFailedTestSuites\":0,\"numFailedTests\":0,\"numPassedTestSuites\":1,\"numPassedTests\":1,\"numPendingTestSuites\":0,\"numPendingTests\":0,\"numRuntimeErrorTestSuites\":0,\"numTodoTests\":0,\"numTotalTestSuites\":1,\"numTotalTests\":1,\"openHandles\":[],\"snapshot\":{\"added\":0,\"didUpdate\":false,\"failure\":false,\"filesAdded\":0,\"filesRemoved\":0,\"filesRemovedList\":[],\"filesUnmatched\":0,\"filesUpdated\":0,\"matched\":0,\"total\":0,\"unchecked\":0,\"uncheckedKeysByFile\":[],\"unmatched\":0,\"updated\":0},\"startTime\":1706509225435,\"success\":true,\"testResults\":[{\"assertionResults\":[{\"ancestorTitles\":[\"logout\"],\"failureMessages\":[],\"fullName\":\"logout should send a POST request to the logout endpoint\",\"location\":null,\"status\":\"passed\",\"title\":\"should send a POST request to the logout endpoint\"}],\"endTime\":1706509226268,\"message\":\"\",\"name\":\"<My project root>/src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\",\"startTime\":1706509225761,\"status\":\"passed\",\"summary\":\"\"}],\"wasInterrupted\":false}",
  "stderr": "PASS src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\n  logout\n    ✓ should send a POST request to the logout endpoint (4 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       1 passed, 1 total\nSnapshots:   0 total\nTime:        0.839 s\nRan all test suites within paths \"=false\", \"src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\".\n\n"
}
["DEBUG" - 2:21:59 PM] [RUN TESTS] [JS/TS] Test run succeeded with default command
{
  "resultType": "success",
  "val": {
    "results": {
      "should send a POST request to the logout endpoint": {
        "passed": true,
        "message": ""
      }
    },
    "metadata": {
      "stdout": "{\"numFailedTestSuites\":0,\"numFailedTests\":0,\"numPassedTestSuites\":1,\"numPassedTests\":1,\"numPendingTestSuites\":0,\"numPendingTests\":0,\"numRuntimeErrorTestSuites\":0,\"numTodoTests\":0,\"numTotalTestSuites\":1,\"numTotalTests\":1,\"openHandles\":[],\"snapshot\":{\"added\":0,\"didUpdate\":false,\"failure\":false,\"filesAdded\":0,\"filesRemoved\":0,\"filesRemovedList\":[],\"filesUnmatched\":0,\"filesUpdated\":0,\"matched\":0,\"total\":0,\"unchecked\":0,\"uncheckedKeysByFile\":[],\"unmatched\":0,\"updated\":0},\"startTime\":1706509225435,\"success\":true,\"testResults\":[{\"assertionResults\":[{\"ancestorTitles\":[\"logout\"],\"failureMessages\":[],\"fullName\":\"logout should send a POST request to the logout endpoint\",\"location\":null,\"status\":\"passed\",\"title\":\"should send a POST request to the logout endpoint\"}],\"endTime\":1706509226268,\"message\":\"\",\"name\":\"<My project root>/src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\",\"startTime\":1706509225761,\"status\":\"passed\",\"summary\":\"\"}],\"wasInterrupted\":false}",
      "stderr": "PASS src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\n  logout\n    ✓ should send a POST request to the logout endpoint (4 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       1 passed, 1 total\nSnapshots:   0 total\nTime:        0.839 s\nRan all test suites within paths \"=false\", \"src/apis/codium_a11c4739-ece9-4062-bca7-ae66b5f4940c_auth.test.js\".\n\n"
    }
  }
}

The --watchAll=false seems to become =false when running the test

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

No branches or pull requests

2 participants