Set up comprehensive frontend testing infrastructure
- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
48
frontend/node_modules/resolve-cwd/index.d.ts
generated
vendored
Normal file
48
frontend/node_modules/resolve-cwd/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
declare const resolveCwd: {
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory.
|
||||
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns The resolved module path.
|
||||
@throws When the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import resolveCwd = require('resolve-cwd');
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/unicorn'
|
||||
|
||||
console.log(resolveCwd('./foo'));
|
||||
//=> '/Users/sindresorhus/unicorn/foo.js'
|
||||
```
|
||||
*/
|
||||
(moduleId: string): string;
|
||||
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory.
|
||||
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns The resolved module path. Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import resolveCwd = require('resolve-cwd');
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/unicorn'
|
||||
|
||||
console.log(resolveCwd.silent('./foo'));
|
||||
//=> '/Users/sindresorhus/unicorn/foo.js'
|
||||
```
|
||||
*/
|
||||
silent(moduleId: string): string | undefined;
|
||||
};
|
||||
|
||||
export = resolveCwd;
|
||||
5
frontend/node_modules/resolve-cwd/index.js
generated
vendored
Normal file
5
frontend/node_modules/resolve-cwd/index.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
module.exports = moduleId => resolveFrom(process.cwd(), moduleId);
|
||||
module.exports.silent = moduleId => resolveFrom.silent(process.cwd(), moduleId);
|
||||
9
frontend/node_modules/resolve-cwd/license
generated
vendored
Normal file
9
frontend/node_modules/resolve-cwd/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
31
frontend/node_modules/resolve-cwd/node_modules/resolve-from/index.d.ts
generated
vendored
Normal file
31
frontend/node_modules/resolve-cwd/node_modules/resolve-from/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
declare const resolveFrom: {
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
||||
|
||||
@param fromDirectory - Directory to resolve from.
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns Resolved module path. Throws when the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
*/
|
||||
(fromDirectory: string, moduleId: string): string;
|
||||
|
||||
/**
|
||||
Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path.
|
||||
|
||||
@param fromDirectory - Directory to resolve from.
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns Resolved module path or `undefined` when the module can't be found.
|
||||
*/
|
||||
silent(fromDirectory: string, moduleId: string): string | undefined;
|
||||
};
|
||||
|
||||
export = resolveFrom;
|
||||
47
frontend/node_modules/resolve-cwd/node_modules/resolve-from/index.js
generated
vendored
Normal file
47
frontend/node_modules/resolve-cwd/node_modules/resolve-from/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
const fs = require('fs');
|
||||
|
||||
const resolveFrom = (fromDirectory, moduleId, silent) => {
|
||||
if (typeof fromDirectory !== 'string') {
|
||||
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
|
||||
}
|
||||
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
||||
}
|
||||
|
||||
try {
|
||||
fromDirectory = fs.realpathSync(fromDirectory);
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
fromDirectory = path.resolve(fromDirectory);
|
||||
} else if (silent) {
|
||||
return;
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const fromFile = path.join(fromDirectory, 'noop.js');
|
||||
|
||||
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
||||
id: fromFile,
|
||||
filename: fromFile,
|
||||
paths: Module._nodeModulePaths(fromDirectory)
|
||||
});
|
||||
|
||||
if (silent) {
|
||||
try {
|
||||
return resolveFileName();
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return resolveFileName();
|
||||
};
|
||||
|
||||
module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId);
|
||||
module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true);
|
||||
9
frontend/node_modules/resolve-cwd/node_modules/resolve-from/license
generated
vendored
Normal file
9
frontend/node_modules/resolve-cwd/node_modules/resolve-from/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
36
frontend/node_modules/resolve-cwd/node_modules/resolve-from/package.json
generated
vendored
Normal file
36
frontend/node_modules/resolve-cwd/node_modules/resolve-from/package.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "resolve-from",
|
||||
"version": "5.0.0",
|
||||
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/resolve-from",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"require",
|
||||
"resolve",
|
||||
"path",
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"import"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
72
frontend/node_modules/resolve-cwd/node_modules/resolve-from/readme.md
generated
vendored
Normal file
72
frontend/node_modules/resolve-cwd/node_modules/resolve-from/readme.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# resolve-from [](https://travis-ci.org/sindresorhus/resolve-from)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install resolve-from
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### resolveFrom(fromDirectory, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveFrom.silent(fromDirectory, moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDirectory
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to resolve from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times:
|
||||
|
||||
```js
|
||||
const resolveFromFoo = resolveFrom.bind(null, 'foo');
|
||||
|
||||
resolveFromFoo('./bar');
|
||||
resolveFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
|
||||
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
43
frontend/node_modules/resolve-cwd/package.json
generated
vendored
Normal file
43
frontend/node_modules/resolve-cwd/package.json
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "resolve-cwd",
|
||||
"version": "3.0.0",
|
||||
"description": "Resolve the path of a module like `require.resolve()` but from the current working directory",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/resolve-cwd",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"require",
|
||||
"resolve",
|
||||
"path",
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"cwd",
|
||||
"current",
|
||||
"working",
|
||||
"directory",
|
||||
"import"
|
||||
],
|
||||
"dependencies": {
|
||||
"resolve-from": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
58
frontend/node_modules/resolve-cwd/readme.md
generated
vendored
Normal file
58
frontend/node_modules/resolve-cwd/readme.md
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# resolve-cwd [](https://travis-ci.org/sindresorhus/resolve-cwd)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install resolve-cwd
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const resolveCwd = require('resolve-cwd');
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/unicorn'
|
||||
|
||||
console.log(resolveCwd('./foo'));
|
||||
//=> '/Users/sindresorhus/unicorn/foo.js'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### resolveCwd(moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveCwd.silent(moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily
|
||||
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user