@iqual/playwright-vrt 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqual/playwright-vrt",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Standalone Visual Regression Testing CLI tool using Playwright",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "src/",
11
11
  "tests/",
12
12
  "playwright.config.ts",
13
+ "tsconfig.json",
13
14
  "README.md"
14
15
  ],
15
16
  "scripts": {
package/src/runner.ts CHANGED
@@ -62,6 +62,7 @@ export async function runVisualTests(options: RunnerOptions): Promise<TestResult
62
62
  // Find the playwright-vrt package directory
63
63
  const packageDir = path.join(__dirname, '..');
64
64
  const playwrightConfigPath = path.join(packageDir, 'playwright.config.ts');
65
+ const tsconfigPath = path.join(packageDir, 'tsconfig.json');
65
66
  const snapshotDir = path.join(process.cwd(), 'playwright-snapshots');
66
67
 
67
68
  // Check if baseline snapshots already exist (look for any .png files in snapshots)
@@ -83,6 +84,7 @@ export async function runVisualTests(options: RunnerOptions): Promise<TestResult
83
84
  // Step 1: Create baseline screenshots
84
85
  await runPlaywright({
85
86
  configPath: playwrightConfigPath,
87
+ tsconfigPath,
86
88
  baseURL: config.referenceUrl,
87
89
  vrtConfig: config,
88
90
  outputDir,
@@ -100,6 +102,7 @@ export async function runVisualTests(options: RunnerOptions): Promise<TestResult
100
102
  // Step 2: Run tests against test URL
101
103
  const exitCode = await runPlaywright({
102
104
  configPath: playwrightConfigPath,
105
+ tsconfigPath,
103
106
  baseURL: config.testUrl,
104
107
  vrtConfig: config,
105
108
  outputDir,
@@ -118,6 +121,7 @@ export async function runVisualTests(options: RunnerOptions): Promise<TestResult
118
121
 
119
122
  interface PlaywrightRunOptions {
120
123
  configPath: string;
124
+ tsconfigPath: string;
121
125
  baseURL: string;
122
126
  vrtConfig: VRTConfig;
123
127
  outputDir: string;
@@ -129,7 +133,12 @@ interface PlaywrightRunOptions {
129
133
 
130
134
  async function runPlaywright(options: PlaywrightRunOptions): Promise<number> {
131
135
  return new Promise((resolve, reject) => {
132
- const args = ['playwright', 'test', '--config', options.configPath];
136
+ const args = [
137
+ 'playwright',
138
+ 'test',
139
+ '--config', options.configPath,
140
+ '--tsconfig', options.tsconfigPath
141
+ ];
133
142
 
134
143
  if (options.updateSnapshots) {
135
144
  args.push('--update-snapshots');
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "lib": ["ES2022"],
6
+ "moduleResolution": "bundler",
7
+ "types": ["bun-types", "@types/node"],
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "allowSyntheticDefaultImports": true,
14
+ "outDir": "./dist",
15
+ "rootDir": "./src"
16
+ },
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist"]
19
+ }