Skip to content

Commit

Permalink
Merge pull request #4 from laineveeti/bugfixing
Browse files Browse the repository at this point in the history
fixed broken tests and workflow
  • Loading branch information
piisamirontta authored Jul 26, 2024
2 parents f0805ab + 0c2566b commit a358aab
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
env:
COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}
COMMIT: ${{ toJson(github.event.commits)[0] }}
SECRET: secrets.SECRET
MONGODB_URI: secrets.MONGODB_URI
TEST_MONGODB_URI: secrets.TEST_MONGODB_URI
DEV_MONGODB_URI: secrets.DEV_MONGODB_URI
SECRET: ${{ secrets.SECRET }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
TEST_MONGODB_URI: ${{ secrets.TEST_MONGODB_URI }}
DEV_MONGODB_URI: ${{ secrets.DEV_MONGODB_URI }}

jobs:
simple_deployment_pipeline:
Expand Down
7 changes: 1 addition & 6 deletions tests/api/test_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ const initialUsers = [
username: 'user1',
name: 'käyttäjä',
password: 'salasana',
},
{
username: 'user2',
name: 'käyttäjä toinen',
password: 'salasana',
},
}
];

const blogsInDb = async () => {
Expand Down
22 changes: 11 additions & 11 deletions utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ let PORT = process.env.PORT;
let ENV = process.env.NODE_ENV;
let MONGODB_URI;
switch (ENV) {
case 'testing':
MONGODB_URI = process.env.TEST_MONGODB_URI;
break;
case 'development':
MONGODB_URI = process.env.DEV_MONGODB_URI;
break;
case 'production':
MONGODB_URI = process.env.MONGODB_URI;
break;
default:
MONGODB_URI = process.env.DEV_MONGODB_URI;
case 'testing':
MONGODB_URI = process.env.TEST_MONGODB_URI;
break;
case 'development':
MONGODB_URI = process.env.DEV_MONGODB_URI;
break;
case 'production':
MONGODB_URI = process.env.MONGODB_URI;
break;
default:
MONGODB_URI = process.env.DEV_MONGODB_URI;
}
let SECRET = process.env.SECRET;

Expand Down
4 changes: 2 additions & 2 deletions utils/logger.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const info = (...params) => {
if (process.env.NODE_ENV !== 'test') {
if (process.env.NODE_ENV !== 'testing') {
console.log(...params);
}
};

const error = (...params) => {
if (process.env.NODE_ENV !== 'test') {
if (process.env.NODE_ENV !== 'testing') {
console.error(...params);
}
};
Expand Down

0 comments on commit a358aab

Please sign in to comment.