Skip to content

Commit

Permalink
Cypress files changed to JS temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
skitterm committed Oct 27, 2023
1 parent ce6ca26 commit 3ed7d02
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/cypress-api/commands.ts → src/cypress-api/commands.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-nocheck

import { snapshot } from '@chromaui/rrweb-snapshot';

Cypress.Commands.add('takeChromaticArchive', () => {
Expand Down
8 changes: 3 additions & 5 deletions src/cypress-api/index.ts → src/cypress-api/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-nocheck

import { writeTestResult } from '../write-archive';
import { SourceMapper } from '../utils/source-mapper';

Expand All @@ -9,11 +7,11 @@ const doArchive = async ({
resourceArchive,
chromaticStorybookParams,
}) => {
let sourceMap: Map<string, string> | null = null;
let sourceMap = null;

if (domSnapshots.length > 0) {
// shortens file names in the last snapshot (which is the automatic one)
const sourceMapper: SourceMapper = new SourceMapper(domSnapshots[domSnapshots.length - 1]);
const sourceMapper = new SourceMapper(domSnapshots[domSnapshots.length - 1]);
sourceMap = sourceMapper.shortenFileNamesLongerThan(250).build();
}

Expand All @@ -31,7 +29,7 @@ const doArchive = async ({

const allSnapshots = Object.fromEntries(
domSnapshots.map((item, index) => [`Snapshot #${index + 1}`, Buffer.from(JSON.stringify(item))])
) as Record<string, Buffer>;
);

await writeTestResult(
{
Expand Down
1 change: 0 additions & 1 deletion src/cypress-api/support.ts → src/cypress-api/support.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-nocheck
import { snapshot } from '@chromaui/rrweb-snapshot';
import './commands';

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowJs": true,
"baseUrl": ".",
"emitDecoratorMetadata": true,
"esModuleInterop": true,
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig((options) => ({
entry: ['src/index.ts', 'src/cypress-api/index.ts', 'src/cypress-api/support.ts'],
entry: ['src/index.ts', 'src/cypress-api/index.js', 'src/cypress-api/support.js'],
splitting: false,
minify: !options.watch,
format: ['cjs', 'esm'],
Expand Down

0 comments on commit 3ed7d02

Please sign in to comment.