Skip to content

test(jmespath): switch tests to vitest #3079

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

Merged
merged 4 commits into from
Sep 17, 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
13 changes: 6 additions & 7 deletions .github/workflows/reusable-run-linting-check-and-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ jobs:
strategy:
matrix:
version: [18, 20]
workspace: ["packages/batch", "packages/commons"]
workspace: [
"packages/batch",
"packages/commons",
"packages/jmespath"
]
fail-fast: false
steps:
- name: Checkout code
Expand Down Expand Up @@ -82,14 +86,11 @@ jobs:
nodeVersion: ${{ matrix.version }}
- name: Run linting
run: |
npm run lint -w packages/commons \
-w packages/logger \
npm run lint -w packages/logger \
-w packages/tracer \
-w packages/metrics \
-w packages/parameters \
-w packages/idempotency \
-w packages/batch \
-w packages/jmespath \
-w packages/parser \
-w packages/event-handler
- name: Run unit tests
Expand All @@ -99,8 +100,6 @@ jobs:
-w packages/metrics \
-w packages/parameters \
-w packages/idempotency \
-w packages/batch \
-w packages/jmespath \
-w packages/parser \
-w packages/event-handler
check-examples:
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
npm t \
-w packages/jmespath \
-w packages/logger \
-w packages/metrics \
-w packages/tracer \
Expand Down
34 changes: 0 additions & 34 deletions packages/jmespath/jest.config.cjs

This file was deleted.

8 changes: 4 additions & 4 deletions packages/jmespath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"access": "public"
},
"scripts": {
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage",
"jest": "jest --detectOpenHandles --verbose",
"test": "vitest --run",
"test:unit": "vitest --run",
"test:unit:coverage": "vitest --run tests/unit --coverage.enabled --coverage.thresholds.100 --coverage.include='src/**'",
"test:unit:types": "echo 'Not applicable for this package'",
"test:e2e": "echo 'Not applicable for this package'",
"watch": "jest --watch --group=unit",
"build:cjs": "tsc --build tsconfig.json && echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json",
"build:esm": "tsc --build tsconfig.esm.json && echo '{ \"type\": \"module\" }' > lib/esm/package.json",
"build": "npm run build:esm & npm run build:cjs",
Expand Down

This file was deleted.

6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/base.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/base
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Base tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/boolean.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/boolean
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Boolean tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/current.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/current
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Current operator tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/escape.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/escape
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Escape characters tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/filters.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/filters
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Filer operator tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/functions.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/functions
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Functions tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/identifiers.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/identifiers
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Identifiers tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/indices.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/indices
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Indices tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/literal.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/literal
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Literal expressions tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/multiselect.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/multiselect
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Multiselect expressions tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/pipe.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/pipe
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Pipe expressions tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/slice.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/slice
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Slices tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/syntax.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/syntax
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Syntax tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/unicode.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/unicode
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Unicode tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/compliance/wildcard.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/compliance/wildcard
*/
import { describe, expect, it } from 'vitest';
import { search } from '../../../src/index.js';

describe('Wildcard tests', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/jmespath/tests/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/**
* Test Compliance with the JMESPath specification
*
* @group unit/jmespath/coverage
*/
import { brotliDecompressSync } from 'node:zlib';
import { fromBase64 } from '@aws-lambda-powertools/commons/utils/base64';
import { describe, expect, it } from 'vitest';
import { Functions } from '../../src/Functions.js';
import { Parser } from '../../src/Parser.js';
import { PowertoolsFunctions } from '../../src/PowertoolsFunctions.js';
Expand Down
7 changes: 7 additions & 0 deletions packages/jmespath/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineProject } from 'vitest/config';

export default defineProject({
test: {
environment: 'node',
},
});
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
'packages/commons/src/types/**',
'packages/event-handler/**',
'packages/idempotency/**',
'packages/jmespath/**',
'packages/jmespath/src/types.ts',
'packages/logger/**',
'packages/metrics/**',
'packages/parameters/**',
Expand Down