Skip to content

Commit

Permalink
test: private packages to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 24, 2024
1 parent b867a25 commit a342ec1
Show file tree
Hide file tree
Showing 60 changed files with 1,008 additions and 873 deletions.
4 changes: 2 additions & 2 deletions private/aws-client-api-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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
Expand Up @@ -5,5 +5,6 @@ export default defineConfig({
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
4 changes: 2 additions & 2 deletions private/aws-client-retry-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"test": "vitest run",
"test:watch": "vitest watch"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
5 changes: 2 additions & 3 deletions private/aws-client-retry-test/src/ClientRetryTest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { test as it, describe, expect } from "vitest";

import { HeadObjectCommand, S3, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
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 @@ -66,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
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-echo-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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
Expand Up @@ -5,5 +5,6 @@ export default defineConfig({
exclude: ["**/*.{integ,e2e,browser}.spec.ts"],
include: ["**/*.spec.ts"],
environment: "node",
globals: true,
},
});
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Encoder as __Encoder } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-json-10/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Encoder as __Encoder } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-json-machinelearning/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Encoder as __Encoder } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Encoder as __Encoder } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-restjson-apigateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types";
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,
},
});
4 changes: 2 additions & 2 deletions private/aws-protocoltests-restjson-glacier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { Encoder as __Encoder } from "@smithy/types";
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-restjson-glacier/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: 2 additions & 2 deletions private/aws-protocoltests-restjson/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { buildQueryString } from "@smithy/querystring-builder";
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-restjson/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: 2 additions & 2 deletions private/aws-protocoltests-restxml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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": "vitest run --passWithNoTests",
"test:watch": "vitest watch --passWithNot"
"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,5 +1,3 @@
import { test as it, expect } from "vitest";

// smithy-typescript generated code
import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http";
import { buildQueryString } from "@smithy/querystring-builder";
Expand Down
10 changes: 10 additions & 0 deletions private/aws-protocoltests-restxml/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,
},
});
Loading

0 comments on commit a342ec1

Please sign in to comment.