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

fixed broken test #4

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading