-
Notifications
You must be signed in to change notification settings - Fork 171
Closed as duplicate of#4318
Closed as duplicate of#4318
Copy link
Labels
bugSomething isn't workingSomething isn't workingduplicateThis issue is a duplicate of an existing oneThis issue is a duplicate of an existing one
Description
Expected Behavior
Simply upgrading 2.24.1 to 2.25.0 should not break existing behavior (unless specified in the release notes). Especially not unit tests that do not run in a Lambda context.
Current Behavior
All unit tests fail with the error message:
Error: Environment variable AWS_REGION is required
Code snippet
The file someFunction.ts
:
import { Logger } from "@aws-lambda-powertools/logger";
const logger = new Logger({
serviceName: "service-name",
});
export const someFunction = (input: string): string => {
logger.info(input);
return input;
};
The file someFunction.test.ts
:
import { describe, expect, it } from "vitest";
import { someFunction } from "./someFunction.js";
describe("test someFunction", () => {
it("should return its parameter", () => {
expect(someFunction("test input")).toBe("test input");
});
});
Steps to Reproduce
- Add the two files provided above and execute the test file.
- It should not fail.
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
2.25.0
AWS Lambda function runtime
22.x
Packaging format used
npm
Execution logs
WtfJoke and p-mercury
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingduplicateThis issue is a duplicate of an existing oneThis issue is a duplicate of an existing one
Type
Projects
Status
Closed