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

Fixing tests #416

Merged
merged 6 commits into from
Jan 21, 2025
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
fail-fast: false
matrix:
node:
- 16
- 18
- 20
- 22
serverless:
- "2"
- "3"
- "4"
# - "4" Official way to test plugins for serverless is missing.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -32,7 +33,7 @@ jobs:
- run: npm i serverless@${{ matrix.serverless }}
- run: npm i @serverless/test@8
# Only install @serverless/test@8 for Serverless v2
if: matrix.serverless != 'latest'
if: matrix.serverless == '2'
- name: Run jest unit tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig");

module.exports = {
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>" }),
moduleNameMapper: Object.assign(pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>" }), {
axios: "axios/dist/node/axios.cjs",
}),
preset: "ts-jest",
testPathIgnorePatterns: ["dist"],
testEnvironment: "node",
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/aws/ServerSideWebsite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class ServerSideWebsite extends AwsConstruct {
let uploadProgress: Progress | undefined;
if (progress) {
uploadProgress = progress.create({
message: 'Uploading assets'
message: "Uploading assets",
});
}

Expand Down
6 changes: 6 additions & 0 deletions test/unit/staticWebsite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ describe("static websites", () => {
UpdateReplacePolicy: "Delete",
DeletionPolicy: "Delete",
Properties: {
PublicAccessBlockConfiguration: {
BlockPublicAcls: false,
BlockPublicPolicy: false,
IgnorePublicAcls: false,
RestrictPublicBuckets: false,
},
WebsiteConfiguration: {
IndexDocument: "index.html",
},
Expand Down
Loading