1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 11:43:51 +00:00

generate core-test-utils

This commit is contained in:
addisonbeck
2025-07-30 16:28:46 -04:00
parent 5e1414a697
commit a8f869ee42
14 changed files with 120 additions and 0 deletions

1
.github/CODEOWNERS vendored
View File

@@ -99,6 +99,7 @@ libs/messaging-internal @bitwarden/team-platform-dev
libs/serialization @bitwarden/team-platform-dev
libs/guid @bitwarden/team-platform-dev
libs/client-type @bitwarden/team-platform-dev
libs/core-test-utils @bitwarden/team-platform-dev
# Web utils used across app and connectors
apps/web/src/utils/ @bitwarden/team-platform-dev
# Web core and shared files

View File

@@ -0,0 +1,5 @@
# core-test-utils
Owned by: platform
Async test tools for state and clients

View File

@@ -0,0 +1,3 @@
import baseConfig from "../../eslint.config.mjs";
export default [...baseConfig];

View File

@@ -0,0 +1,10 @@
module.exports = {
displayName: "core-test-utils",
preset: "../../jest.preset.js",
testEnvironment: "node",
transform: {
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
},
moduleFileExtensions: ["ts", "js", "html"],
coverageDirectory: "../../coverage/libs/core-test-utils",
};

View File

@@ -0,0 +1,11 @@
{
"name": "@bitwarden/core-test-utils",
"version": "0.0.1",
"description": "Async test tools for state and clients",
"private": true,
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "GPL-3.0",
"author": "platform"
}

View File

@@ -0,0 +1,33 @@
{
"name": "core-test-utils",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/core-test-utils/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/core-test-utils",
"main": "libs/core-test-utils/src/index.ts",
"tsConfig": "libs/core-test-utils/tsconfig.lib.json",
"assets": ["libs/core-test-utils/*.md"]
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/core-test-utils/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/core-test-utils/jest.config.js"
}
}
}
}

View File

@@ -0,0 +1,8 @@
import * as lib from "./index";
describe("core-test-utils", () => {
// This test will fail until something is exported from index.ts
it("should work", () => {
expect(lib).toBeDefined();
});
});

View File

View File

@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": ["src/**/*.ts", "src/**/*.js"],
"exclude": ["**/build", "**/dist"]
}

View File

@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.js", "src/**/*.spec.ts"]
}

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"moduleResolution": "node10",
"types": ["jest", "node"]
},
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
}

9
package-lock.json generated
View File

@@ -332,6 +332,11 @@
"name": "@bitwarden/components",
"version": "0.0.0"
},
"libs/core-test-utils": {
"name": "@bitwarden/core-test-utils",
"version": "0.0.1",
"license": "GPL-3.0"
},
"libs/dirt/card": {
"name": "@bitwarden/dirt-card",
"version": "0.0.0",
@@ -4572,6 +4577,10 @@
"resolved": "libs/components",
"link": true
},
"node_modules/@bitwarden/core-test-utils": {
"resolved": "libs/core-test-utils",
"link": true
},
"node_modules/@bitwarden/desktop": {
"resolved": "apps/desktop",
"link": true

View File

@@ -28,6 +28,7 @@
"@bitwarden/client-type": ["libs/client-type/src/index.ts"],
"@bitwarden/common/*": ["./libs/common/src/*"],
"@bitwarden/components": ["./libs/components/src"],
"@bitwarden/core-test-utils": ["libs/core-test-utils/src/index.ts"],
"@bitwarden/dirt-card": ["./libs/dirt/card/src"],
"@bitwarden/generator-components": ["./libs/tools/generator/components/src"],
"@bitwarden/generator-core": ["./libs/tools/generator/core/src"],