Skip to content

Commit a4d576d

Browse files
committedMar 8, 2024
chore: added vitest for node and browser testing in authentication/azure

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed
 

‎packages/authentication/azure/package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"build": "npm run build:cjs && npm run build:esm",
1010
"build:cjs": "tsc -b tsconfig.cjs.json",
1111
"build:esm": "tsc -b tsconfig.es.json",
12-
"test": "npm run build && mocha 'dist/cjs/test/**/*.js'",
12+
"test:node": "vitest run",
13+
"test:browser": "vitest run --browser.name=chrome --browser.headless",
14+
"test": "npm run test:node && npm run test:browser",
1315
"lint": "eslint . --ext .ts",
1416
"lint:fix": "eslint . --ext .ts --fix",
1517
"clean": "rm -r ./dist"
@@ -36,5 +38,11 @@
3638
},
3739
"publishConfig": {
3840
"access": "public"
41+
},
42+
"devDependencies": {
43+
"@vitest/coverage-v8": "^1.3.1",
44+
"@vitest/ui": "^1.3.1",
45+
"vitest": "^1.3.1",
46+
"webdriverio": "^8.33.0"
3947
}
4048
}

‎packages/authentication/azure/test/azureIdentityAuthenticationTest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
BaseBearerTokenAuthenticationProvider,
1111
RequestInformation,
1212
} from "@microsoft/kiota-abstractions";
13-
import { assert } from "chai";
13+
import { assert, describe, it } from "vitest";
1414
import * as sinon from "sinon";
1515

1616
import { AzureIdentityAuthenticationProvider } from "../src";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig, configDefaults } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: [...configDefaults.exclude, "**/test{Entity,Enum}.ts"],
6+
include: [...configDefaults.include, "test/**/*.ts"],
7+
coverage: {
8+
reporter: ["html"],
9+
},
10+
},
11+
});

0 commit comments

Comments
 (0)
Please sign in to comment.