Skip to content

Commit

Permalink
unit-test fix (copy utils in dockerfile)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelalvaigle committed Nov 27, 2024
1 parent ec18ad8 commit 22f808f
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 57 deletions.
1 change: 1 addition & 0 deletions users/authservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN npm install

# Copy the app source code to the working directory
COPY . .
COPY utils /usr/src/authservice/utils

# Expose the port the app runs on
EXPOSE 8002
Expand Down
12 changes: 0 additions & 12 deletions users/authservice/utils/passwordUtils.js

This file was deleted.

16 changes: 0 additions & 16 deletions users/authservice/utils/tokenUtils.js

This file was deleted.

1 change: 1 addition & 0 deletions users/userservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN npm install

# Copy the app source code to the working directory
COPY . .
COPY utils /usr/src/userservice/utils

# Expose the port the app runs on
EXPOSE 8001
Expand Down
2 changes: 1 addition & 1 deletion users/userservice/user-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ beforeAll(async () => {
mongoServer = await MongoMemoryServer.create();
const mongoUri = mongoServer.getUri();
process.env.MONGODB_URI = mongoUri;
app = require('./user-service');
app = (await import('./user-service.js')).default; // Import app dynamically to ensure MONGODB_URI is set
});

afterAll(async () => {
Expand Down
12 changes: 0 additions & 12 deletions users/userservice/utils/passwordUtils.js

This file was deleted.

16 changes: 0 additions & 16 deletions users/userservice/utils/tokenUtils.js

This file was deleted.

0 comments on commit 22f808f

Please sign in to comment.