-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
112 changed files
with
833 additions
and
707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
clearMocks: true, | ||
environment: 'node', | ||
mockReset: true, | ||
restoreMocks: true, | ||
|
||
coverage: { | ||
all: true, | ||
clean: true, | ||
enabled: true, | ||
provider: 'istanbul', | ||
skipFull: true, | ||
|
||
thresholds: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
}, | ||
}); | ||
export { default } from '@quisido/vitest-config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,6 @@ | ||
import { mapUnknownToString } from 'fmrs'; | ||
import MetricName from '../constants/metric-name.js'; | ||
import getState from '../utils/get-state.js'; | ||
import getTelemetry from '../utils/get-telemetry.js'; | ||
import isConsole from '../utils/is-console.js'; | ||
|
||
export default function getConsole(): Console { | ||
const { console } = getState(); | ||
|
||
if (isConsole(console)) { | ||
return console; | ||
} | ||
|
||
const { emitPublicMetric, logPrivateError, logPublicError } = getTelemetry(); | ||
if (typeof console === 'undefined') { | ||
emitPublicMetric({ name: MetricName.MissingConsole }); | ||
return console; | ||
} | ||
|
||
emitPublicMetric({ name: MetricName.InvalidConsole }); | ||
|
||
logPrivateError( | ||
new Error('Invalid console', { | ||
cause: mapUnknownToString(console), | ||
}), | ||
); | ||
|
||
logPublicError( | ||
new Error('Invalid console', { | ||
cause: typeof console, | ||
}), | ||
); | ||
|
||
return console; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
import CONFIG, { INLINE_CONFIG } from '@quisido/vitest-config'; | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
...CONFIG, | ||
test: { | ||
clearMocks: true, | ||
...INLINE_CONFIG, | ||
environment: 'jsdom', | ||
mockReset: true, | ||
restoreMocks: true, | ||
|
||
coverage: { | ||
all: true, | ||
clean: true, | ||
enabled: true, | ||
provider: 'istanbul', | ||
skipFull: true, | ||
|
||
thresholds: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"format": "table-flipped", | ||
"ignoreRules": ["cjs-resolves-to-esm"], | ||
"pack": "." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/coverage/ | ||
/dist/ | ||
/node_modules/ | ||
/.eslintcache | ||
/*.cpuprofile | ||
/*.iml | ||
/*.tsbuildinfo | ||
/*-*.*.*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/.vscode/ | ||
/coverage/ | ||
/node_modules/ | ||
/src/ | ||
/.*.json | ||
/.*ignore | ||
/.*rc.* | ||
/.eslintcache | ||
/*.config.* | ||
/*.cpuprofile | ||
/*.iml | ||
/*.tsbuildinfo | ||
/*-*.*.*.tgz | ||
/tsconfig.* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"files.exclude": { | ||
"coverage/": true, | ||
"dist/": true, | ||
"node_modules/": true, | ||
".attw.json": true, | ||
".eslintcache": true, | ||
"*.cpuprofile": true, | ||
"*.tsbuildinfo": true, | ||
"vitest.config.ts.timestamp-*-*.mjs": true | ||
} | ||
} |
Oops, something went wrong.