Skip to content

Commit 876a703

Browse files
authored
test(logger): switch e2e tests to vitest (#3148)
1 parent 404b302 commit 876a703

6 files changed

+8
-54
lines changed

packages/logger/jest.config.cjs

-30
This file was deleted.

packages/logger/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"test:unit": "vitest --run tests/unit",
1515
"test:unit:coverage": "vitest --run tests/unit --coverage.enabled --coverage.thresholds.100 --coverage.include='src/**'",
1616
"test:unit:types": "echo 'Not Implemented'",
17-
"test:e2e:nodejs18x": "RUNTIME=nodejs18x jest --group=e2e",
18-
"test:e2e:nodejs20x": "RUNTIME=nodejs20x jest --group=e2e",
19-
"test:e2e": "jest --group=e2e",
20-
"watch": "jest --watch --group=unit",
17+
"test:unit:watch": "vitest tests/unit",
18+
"test:e2e:nodejs18x": "RUNTIME=nodejs18x vitest --run tests/e2e",
19+
"test:e2e:nodejs20x": "RUNTIME=nodejs20x vitest --run tests/e2e",
20+
"test:e2e": "vitest --run tests/e2e",
2121
"build:cjs": "tsc --build tsconfig.json && echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json",
2222
"build:esm": "tsc --build tsconfig.esm.json && echo '{ \"type\": \"module\" }' > lib/esm/package.json",
2323
"build": "npm run build:esm & npm run build:cjs",

packages/logger/tests/e2e/basicFeatures.middy.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
/**
2-
* Test logger basic features
3-
*
4-
* @group e2e/logger/basicFeatures
5-
*/
61
import { join } from 'node:path';
72
import {
83
TestInvocationLogs,
94
TestStack,
105
invokeFunction,
116
} from '@aws-lambda-powertools/testing-utils';
127
import type { APIGatewayAuthorizerResult } from 'aws-lambda';
8+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
139
import { LoggerTestNodejsFunction } from '../helpers/resources.js';
1410
import {
1511
RESOURCE_NAME_PREFIX,

packages/logger/tests/e2e/childLogger.manual.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
/**
2-
* Test logger child logger
3-
*
4-
* @group e2e/logger/childLogger
5-
*/
61
import { join } from 'node:path';
72
import {
83
TestInvocationLogs,
94
TestStack,
105
invokeFunction,
116
} from '@aws-lambda-powertools/testing-utils';
7+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
128
import { LoggerTestNodejsFunction } from '../helpers/resources.js';
139
import {
1410
RESOURCE_NAME_PREFIX,

packages/logger/tests/e2e/logEventEnvVarSetting.middy.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
/**
2-
* Test logger basic features
3-
*
4-
* @group e2e/logger/logEventEnvVarSetting
5-
*/
61
import { join } from 'node:path';
72
import {
83
TestInvocationLogs,
94
TestStack,
105
invokeFunction,
116
} from '@aws-lambda-powertools/testing-utils';
7+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
128
import { LoggerTestNodejsFunction } from '../helpers/resources.js';
139
import {
1410
RESOURCE_NAME_PREFIX,

packages/logger/tests/e2e/sampleRate.decorator.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
/**
2-
* Test logger sample rate feature
3-
*
4-
* @group e2e/logger/sampleRate
5-
*/
61
import { randomUUID } from 'node:crypto';
72
import { join } from 'node:path';
83
import {
94
TestInvocationLogs,
105
TestStack,
116
invokeFunction,
127
} from '@aws-lambda-powertools/testing-utils';
8+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
139
import { LoggerTestNodejsFunction } from '../helpers/resources.js';
1410
import {
1511
RESOURCE_NAME_PREFIX,

0 commit comments

Comments
 (0)