Skip to content

Commit c49cd1b

Browse files
initial visual-snapshots package
1 parent e75b5c7 commit c49cd1b

13 files changed

+8899
-0
lines changed

Diff for: visual-js/visual-snapshots/.eslintrc.cjs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
project: './tsconfig.json',
6+
tsconfigRootDir: __dirname,
7+
sourceType: 'module',
8+
},
9+
plugins: ['@typescript-eslint'],
10+
extends: [
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:prettier/recommended',
13+
],
14+
root: true,
15+
env: {
16+
node: true,
17+
jest: true,
18+
},
19+
ignorePatterns: ['.eslintrc.js', 'codegen.ts', 'jest.config.js', 'src/graphql/__generated__'],
20+
rules: {
21+
'@typescript-eslint/interface-name-prefix': 'off',
22+
'@typescript-eslint/explicit-function-return-type': 'off',
23+
'@typescript-eslint/explicit-module-boundary-types': 'off',
24+
'@typescript-eslint/no-explicit-any': 'off',
25+
26+
// Allow unused vars that start with _
27+
"@typescript-eslint/no-unused-vars": [
28+
"warn",
29+
{
30+
"argsIgnorePattern": "^_",
31+
"varsIgnorePattern": "^_",
32+
"caughtErrorsIgnorePattern": "^_"
33+
}
34+
],
35+
},
36+
};

Diff for: visual-js/visual-snapshots/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.work
2+
build/
3+
lib/
4+
coverage/
5+
.parent/

Diff for: visual-js/visual-snapshots/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Sauce Labs Visual client library
2+
3+
This package provides a client and a CLI tool to interact with Sauce Labs Visual API.
4+
5+
## Installation
6+
7+
```sh
8+
npm install --save @saucelabs/visual-snapshots
9+
```
10+
11+
## Development
12+
13+
Build:
14+
15+
```sh
16+
npm run build
17+
```
18+
19+
Execute:
20+
21+
```sh
22+
node build/index.js [command] [params]
23+
```
24+
25+
Run tests:
26+
27+
```sh
28+
npx jest
29+
```

Diff for: visual-js/visual-snapshots/jest.config.cjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
// [...]
4+
preset: 'ts-jest/presets/default-esm', // or other ESM presets
5+
moduleNameMapper: {
6+
'^(\\.{1,2}/.*)\\.js$': '$1',
7+
},
8+
testPathIgnorePatterns: ['/build/'],
9+
transform: {
10+
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
11+
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
12+
'^.+\\.tsx?$': [
13+
'ts-jest',
14+
{
15+
useESM: true,
16+
},
17+
],
18+
},
19+
setupFiles: ['<rootDir>/setEnvVars.ts'],
20+
}

0 commit comments

Comments
 (0)