Integrate Wallaby (#66)
This commit is contained in:
parent
defb538561
commit
bb2c7de299
4 changed files with 32 additions and 9 deletions
|
@ -15,8 +15,18 @@ module.exports = {
|
||||||
setupFiles: ['./theatre/shared/src/setupTestEnv.ts'],
|
setupFiles: ['./theatre/shared/src/setupTestEnv.ts'],
|
||||||
automock: false,
|
automock: false,
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.tsx?$': 'esbuild-jest',
|
'^.+\\.tsx?$': [
|
||||||
'^.+\\.js$': 'esbuild-jest',
|
'esbuild-jest',
|
||||||
|
{
|
||||||
|
sourcemap: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'^.+\\.js$': [
|
||||||
|
'esbuild-jest',
|
||||||
|
{
|
||||||
|
sourcemap: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import Emitter from './Emitter'
|
import Emitter from './Emitter'
|
||||||
|
|
||||||
describe.only('DataVerse.Emitter', () => {
|
describe('DataVerse.Emitter', () => {
|
||||||
it('should work', () => {
|
it('should work', () => {
|
||||||
const e: Emitter<string> = new Emitter()
|
const e: Emitter<string> = new Emitter()
|
||||||
e.emit('no one will see this')
|
e.emit('no one will see this')
|
||||||
|
|
|
@ -68,11 +68,11 @@ describe(`numberRoundingUtils()`, () => {
|
||||||
sign
|
sign
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
for (let i = 0; i < 2000; i++) {
|
test(`roundestNumberBetween() => fuzzy`, () => {
|
||||||
const from = toPrecision(getRandomNumber())
|
for (let i = 0; i < 2000; i++) {
|
||||||
const to = toPrecision(getRandomNumber())
|
const from = toPrecision(getRandomNumber())
|
||||||
|
const to = toPrecision(getRandomNumber())
|
||||||
|
|
||||||
test(`roundestNumberBetween(${from}, ${to}) => fuzzy`, () => {
|
|
||||||
const result = roundestNumberBetween(from, to)
|
const result = roundestNumberBetween(from, to)
|
||||||
if (from < to) {
|
if (from < to) {
|
||||||
if (result < from || result > to) {
|
if (result < from || result > to) {
|
||||||
|
@ -83,8 +83,8 @@ describe(`numberRoundingUtils()`, () => {
|
||||||
throw new Error(`Invalid: ${to} ${from} ${result}`)
|
throw new Error(`Invalid: ${to} ${from} ${result}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
})
|
})
|
||||||
describe(`roundestIntegerBetween`, () => {
|
describe(`roundestIntegerBetween`, () => {
|
||||||
example(roundestIntegerBetween, [-1, 6], 0, {})
|
example(roundestIntegerBetween, [-1, 6], 0, {})
|
||||||
|
|
13
wallaby.conf.js
Normal file
13
wallaby.conf.js
Normal 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',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue