【问题标题】:start-server-and-test stuck at server start - ( Error: Timed out waiting )启动服务器和测试卡在服务器启动时 - (错误:等待超时)
【发布时间】:2022-11-30 06:58:58
【问题描述】:

我试图使用start-server-and-test,但我有一个 graphQL 服务器。我已经尝试了很多端点,但它似乎不会返回 200 状态,因为它不会执行第二个命令。

"scripts": {
    "start": "cross-env NODE_ENV=development nodemon --files --exec ts-node src/index.ts",
    "test-server": "cross-env NODE_ENV=test ts-node --files src/index.ts ",
    "typeorm": "typeorm-ts-node-commonjs",
    "test": "cross-env NODE_ENV=test jest",
    "ci": "start-server-and-test test-server https://localhost:4000 test",
    "gen-schema-types": "gql2ts src/schema.graphql -o src/types/schema.d.ts"
}

为什么第二个命令没有执行?

【问题讨论】:

    标签: node.js testing types graphql


    【解决方案1】:

    您的本地主机 url 应该是 http 而不是 https 吗?

        "ci": "start-server-and-test test-server http://localhost:4000 test",
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-24
      • 1970-01-01
      • 2021-05-08
      • 2021-04-21
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多