Skip to content

Commit

Permalink
test: convert private packages to vitest (#6587)
Browse files Browse the repository at this point in the history
* test: conversions to vitest

* fix: compilation fixes for clients

* test: private tests to vitest

* chore: update vitest script

* test: private packages to vitest

* test: there are no tests in echo service
  • Loading branch information
kuhe authored Oct 24, 2024
1 parent 9a56eba commit 38debde
Show file tree
Hide file tree
Showing 67 changed files with 260 additions and 220 deletions.
5 changes: 0 additions & 5 deletions private/aws-client-api-test/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-client-api-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { test as it, describe, expect } from "vitest";

import { ClientS3InterfaceTest } from "./ClientS3InterfaceTest";
import { RESOLVED_FIELDS } from "./RESOLVED_FIELDS";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export default defineConfig({
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
5 changes: 0 additions & 5 deletions private/aws-client-retry-test/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-client-retry-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion private/aws-client-retry-test/src/ClientRetryTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { HttpHandler, HttpResponse } from "@smithy/protocol-http";
import { AwsCredentialIdentity, RequestHandlerOutput } from "@smithy/types";
import { ConfiguredRetryStrategy, StandardRetryStrategy } from "@smithy/util-retry";
import { Readable } from "stream";
import { describe, expect, test as it, vi } from "vitest";

const MOCK_REGION = "us-west-2";

Expand Down Expand Up @@ -64,7 +65,7 @@ describe("util-retry integration tests", () => {
});

it("should retry until success", async () => {
const mockHandle = jest
const mockHandle = vi
.fn()
.mockResolvedValueOnce(mockThrottled)
.mockResolvedValueOnce(mockThrottled)
Expand Down
10 changes: 10 additions & 0 deletions private/aws-client-retry-test/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
4 changes: 0 additions & 4 deletions private/aws-echo-service/jest.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions private/aws-echo-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test as it, describe, expect } from "vitest";

import { S3Control } from "@aws-sdk/client-s3-control";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../aws-util-test/src";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { test as it, describe, expect } from "vitest";

import { AccessAnalyzer } from "@aws-sdk/client-accessanalyzer";
import { S3 } from "@aws-sdk/client-s3";
import { XRay } from "@aws-sdk/client-xray";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../../private/aws-util-test/src";

Expand Down
3 changes: 2 additions & 1 deletion private/aws-middleware-test/src/middleware-endpoint.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test as it, describe, expect } from "vitest";

import { S3 } from "@aws-sdk/client-s3";
import { S3Control } from "@aws-sdk/client-s3-control";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../aws-util-test/src";

Expand Down
3 changes: 2 additions & 1 deletion private/aws-middleware-test/src/middleware-retry.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test as it, describe, expect } from "vitest";

import { Lambda } from "@aws-sdk/client-lambda";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../aws-util-test/src";

Expand Down
3 changes: 2 additions & 1 deletion private/aws-middleware-test/src/middleware-serde.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { test as it, describe } from "vitest";

import { EC2 } from "@aws-sdk/client-ec2";
import { S3 } from "@aws-sdk/client-s3";
import { SageMaker } from "@aws-sdk/client-sagemaker";
import { SageMakerRuntime } from "@aws-sdk/client-sagemaker-runtime";
import { describe, test as it } from "vitest";

import { requireRequestsFrom } from "../../aws-util-test/src";

Expand Down
3 changes: 2 additions & 1 deletion private/aws-middleware-test/src/util-stream.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { test as it, describe, expect } from "vitest";

import { Lambda } from "@aws-sdk/client-lambda";
import { HttpHandler, HttpResponse } from "@smithy/protocol-http";
import { HttpRequest as IHttpRequest } from "@smithy/types";
import { Uint8ArrayBlobAdapter } from "@smithy/util-stream";
import { fromUtf8 } from "@smithy/util-utf8";
import { Readable } from "stream";
import { describe, expect, test as it } from "vitest";

import { requireRequestsFrom } from "../../aws-util-test/src";

Expand Down
10 changes: 10 additions & 0 deletions private/aws-middleware-test/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ An EC2 query service that sends query requests and XML responses.

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-ec2
To install this package, simply type add or install @aws-sdk/aws-protocoltests-ec2
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-ec2`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-ec2/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-ec2/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-json-10/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS SDK for JavaScript JSONRPC10 Client for Node.js, Browser and React Native.

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-json-10
To install this package, simply type add or install @aws-sdk/aws-protocoltests-json-10
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-json-10`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-json-10/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-json-10/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-json-10/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-json-machinelearning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS SDK for JavaScript MachineLearning Client for Node.js, Browser and React Nat

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-json-machinelearning
To install this package, simply type add or install @aws-sdk/aws-protocoltests-json-machinelearning
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-json-machinelearning`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-json-machinelearning/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-json-machinelearning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-json-machinelearning/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS SDK for JavaScript JsonProtocol Client for Node.js, Browser and React Native

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-json
To install this package, simply type add or install @aws-sdk/aws-protocoltests-json
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-json`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-json/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-json/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A query service that sends query requests and XML responses.

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-query
To install this package, simply type add or install @aws-sdk/aws-protocoltests-query
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-query`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-query/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-query/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-restjson-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS SDK for JavaScript APIGateway Client for Node.js, Browser and React Native.

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-restjson-apigateway
To install this package, simply type add or install @aws-sdk/aws-protocoltests-restjson-apigateway
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-restjson-apigateway`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-restjson-apigateway/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-restjson-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-restjson-apigateway/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
2 changes: 1 addition & 1 deletion private/aws-protocoltests-restjson-glacier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS SDK for JavaScript Glacier Client for Node.js, Browser and React Native.

## Installing

To install the this package, simply type add or install @aws-sdk/aws-protocoltests-restjson-glacier
To install this package, simply type add or install @aws-sdk/aws-protocoltests-restjson-glacier
using your favorite package manager:

- `npm install @aws-sdk/aws-protocoltests-restjson-glacier`
Expand Down
5 changes: 0 additions & 5 deletions private/aws-protocoltests-restjson-glacier/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion private/aws-protocoltests-restjson-glacier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
"test": "jest --coverage --passWithNoTests"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
Loading

0 comments on commit 38debde

Please sign in to comment.