Skip to content

Commit

Permalink
Try fix failing test on actions
Browse files Browse the repository at this point in the history
  • Loading branch information
outisa committed Aug 3, 2024
1 parent 2c354a5 commit 5feec67
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
11 changes: 8 additions & 3 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,16 @@ if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
mongoose.set('strictQuery', false)
mongoose.connect(MONGODB_URI)
} else {
var mongoDB = 'mongodb://localhost:27017/test'
const mongoDB = 'mongodb://localhost:27017/test'
mongoose.set('strictQuery', false)
mongoose.connect(mongoDB)
var db = mongoose.connection
db.on('error', logger.error('MongoDB connection error:'))
mongoose.connection.on('error', error => {
if (error.message.code === 'ETIMEDOUT') {
logger.error(error)
mongoose.connect(mongoDB)
}
logger.error(error)
})
}

app.use(cors())
Expand Down
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "NODE_ENV=production node index.js",
"dev": "cross-env NODE_ENV=development nodemon index.js",
"test": "NODE_ENV=test node --test --test-force-exit",
"test-githubactions": "cross-env NODE_ENV=testserver node --test **/*.test.js",
"test-githubactions": "cross-env NODE_ENV=testserver node --test --test-force-exit",
"build:ui": "rm -rf build && cd ../frontend && npm run build --prod && cp -r build ../backend",
"lint": "eslint .",
"prettier": "prettier",
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"config": {
"mongodbMemoryServer": {
"version": "4.2.8"
"version": "4.4.0"
}
}
}
1 change: 0 additions & 1 deletion backend/tests/game_testing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ describe('it is possible to do tests', () => {
const testCaseAdded = await caseToAdd.save()

const data = [testMap['test0']]
console.log(addedTests, data)
let res = await api
.post(`/api/game/${testCaseAdded.id}/checkTests`)
.set('Authorization', `bearer ${user.body.token}`)
Expand Down

0 comments on commit 5feec67

Please sign in to comment.