Integrate Wallaby (#66)

This commit is contained in:
Andrew Prifer 2022-02-21 13:33:08 +01:00 committed by GitHub
parent defb538561
commit bb2c7de299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 9 deletions

View file

@ -15,8 +15,18 @@ module.exports = {
setupFiles: ['./theatre/shared/src/setupTestEnv.ts'],
automock: false,
transform: {
'^.+\\.tsx?$': 'esbuild-jest',
'^.+\\.js$': 'esbuild-jest',
'^.+\\.tsx?$': [
'esbuild-jest',
{
sourcemap: true,
},
],
'^.+\\.js$': [
'esbuild-jest',
{
sourcemap: true,
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}

View file

@ -1,6 +1,6 @@
import Emitter from './Emitter'
describe.only('DataVerse.Emitter', () => {
describe('DataVerse.Emitter', () => {
it('should work', () => {
const e: Emitter<string> = new Emitter()
e.emit('no one will see this')

View file

@ -68,11 +68,11 @@ describe(`numberRoundingUtils()`, () => {
sign
)
}
for (let i = 0; i < 2000; i++) {
const from = toPrecision(getRandomNumber())
const to = toPrecision(getRandomNumber())
test(`roundestNumberBetween() => fuzzy`, () => {
for (let i = 0; i < 2000; i++) {
const from = toPrecision(getRandomNumber())
const to = toPrecision(getRandomNumber())
test(`roundestNumberBetween(${from}, ${to}) => fuzzy`, () => {
const result = roundestNumberBetween(from, to)
if (from < to) {
if (result < from || result > to) {
@ -83,8 +83,8 @@ describe(`numberRoundingUtils()`, () => {
throw new Error(`Invalid: ${to} ${from} ${result}`)
}
}
})
}
}
})
})
describe(`roundestIntegerBetween`, () => {
example(roundestIntegerBetween, [-1, 6], 0, {})

13
wallaby.conf.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = () => {
return {
autoDetect: true,
tests: [
'theatre/**/*.test.ts',
'packages/dataverse/**/*.test.ts',
'!**/node_modules/**',
],
testFramework: {
configFile: './jest.config.js',
},
}
}