Skip to content

Commit

Permalink
chore: add d.ts file compilation to testkit (#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
uziab authored Nov 20, 2024
1 parent 32fd194 commit 3af508a
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 30 deletions.
4 changes: 3 additions & 1 deletion packages/testkit/__TESTS__/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ test.describe("dropdown Class with Storybook", () => {
});

test.fixme("set dropdown value", async ({ page }) => {
await page.waitForTimeout(3000);
// extended wait for interaction test to finish
await page.waitForTimeout(10000);
await DropDown.inputField.setText("");
await DropDown.selectItem("2");
await page.waitForTimeout(500);
expect(await DropDown.getText()).toContain("2");
Expand Down
6 changes: 6 additions & 0 deletions packages/testkit/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint.config.js
export default [
{
ignores: ["node_modules/", "dist/", "*.config.js", "*.spec.js"],
}
];
18 changes: 16 additions & 2 deletions packages/testkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"TESTING",
"E2E"
],
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/esm/index.js",
"types": "./dist/index.d.ts"
}
},
"author": "monday.com",
"homepage": "https://github.com/mondaycom/vibe#readme",
"license": "ISC",
Expand All @@ -17,13 +26,18 @@
},
"scripts": {
"test:e2e": "npx playwright test",
"build": "tsc",
"start-server": "yarn lerna run storybook --scope=monday-ui-react-core"
"build:cjs": "tsc",
"build:esm": "tsc --project tsconfig.esm.json",
"build": "yarn build:cjs && yarn build:esm",
"start-server": "yarn lerna run storybook --scope=monday-ui-react-core",
"lint": "eslint \"./**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "yarn lint -- --fix"
},
"bugs": {
"url": "https://github.com/mondaycom/vibe/issues"
},
"devDependencies": {
"eslint": "^8.23.0",
"@playwright/test": "1.45.3"
}
}
8 changes: 8 additions & 0 deletions packages/testkit/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/esm",
"module": "esnext"
},
"include": ["./**/*.ts"]
}
45 changes: 18 additions & 27 deletions packages/testkit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"strict": true,
"sourceMap": true,
"strictNullChecks": true,
"moduleResolution": "node",
"importHelpers": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"rootDir": ".",
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
},
"include": [ "buttons", "inputs", "navigation", "pickers", "popover", "text", "utils", "BaseElement.ts", "index.ts"]
}
"compilerOptions": {
"lib": ["ESNext"],
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"skipLibCheck": true,
"noImplicitAny": true,
"outDir": "dist",
"baseUrl": ".",
"allowSyntheticDefaultImports": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["./**/*.ts"],
"exclude": ["__TESTS__", "./playwright.config.ts", "node_modules", "dist"]
}

0 comments on commit 3af508a

Please sign in to comment.