如何在gitlab问题上用mongodb解决开玩笑
Jest-MongoDB(NPM Run测试)在本地工作良好,但在Gitlab-Ci上不起作用,它突然在工作中停止工作并显示以下错误。
文件:jest.config.js
const merge = require('merge');
const ts_preset = require('ts-jest/jest-preset');
const jest_mongodb = require('@shelf/jest-mongodb/jest-preset');
module.exports = merge.recursive(ts_preset, jest_mongodb, {
globals: {
test_url: `http://${process.env.HOST || '127.0.0.1'}:${
process.env.PORT || 3000
}`,
},
preset: '@shelf/jest-mongodb',
setupFiles: ['dotenv/config'],
testPathIgnorePatterns: ['<rootDir>/__tests__/helpers'],
});
log:
Error: Jest: Got error running
globalSetup - /builds/elo/elo-api/node_modules/@shelf/jest-mongodb/setup.js,
reason: Instance Exited before
being ready and without throwing an error!
jest-mongodb (npm run test) work well on local but not work on gitlab-ci, it was working suddenly it stopped working and show the following error.
file: jest.config.js
const merge = require('merge');
const ts_preset = require('ts-jest/jest-preset');
const jest_mongodb = require('@shelf/jest-mongodb/jest-preset');
module.exports = merge.recursive(ts_preset, jest_mongodb, {
globals: {
test_url: `http://${process.env.HOST || '127.0.0.1'}:${
process.env.PORT || 3000
}`,
},
preset: '@shelf/jest-mongodb',
setupFiles: ['dotenv/config'],
testPathIgnorePatterns: ['<rootDir>/__tests__/helpers'],
});
Log:
Error: Jest: Got error running
globalSetup - /builds/elo/elo-api/node_modules/@shelf/jest-mongodb/setup.js,
reason: Instance Exited before
being ready and without throwing an error!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论