Skip to content

Commit

Permalink
chore: Linted code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Oct 23, 2023
1 parent a85f833 commit 23cf1a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion test/print.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function removeStyle(source: string): string {
return source.replaceAll(/\u001B\[\d+m/g, '')
}

function loggerBase() {}
function loggerBase(): void {}

defaultOptions.iterations = 10

Expand Down
33 changes: 18 additions & 15 deletions test/worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import t from 'tap'
import { AsyncTest, Result, percentiles } from '../src/index.js'
import { percentiles, type AsyncTest, type Result } from '../src/index.js'
import { runWorker } from '../src/worker.js'

t.test('Worker execution - Handle sync functions that succeed', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -49,7 +49,8 @@ t.test('Worker execution - Handle sync functions that throw errors', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

async function main() {
/* eslint-disable-next-line @typescript-eslint/require-await */
async function main(): Promise<void> {
mainCalls++
throw new Error('FAILED')
}
Expand Down Expand Up @@ -176,7 +177,8 @@ t.test('Worker execution - Handle promise functions that resolve', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

async function main() {
/* eslint-disable-next-line @typescript-eslint/require-await */
async function main(): Promise<void> {
mainCalls++
}

Expand Down Expand Up @@ -219,7 +221,8 @@ t.test('Worker execution - Handle promise functions that reject', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
/* eslint-disable-next-line @typescript-eslint/require-await */
async function main(): Promise<void> {
mainCalls++
throw new Error('FAILED')
}
Expand Down Expand Up @@ -261,7 +264,7 @@ t.test('Worker execution - Handle warmup mode enabled', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -305,7 +308,7 @@ t.test('Worker execution - Handle warmup mode disabled', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -350,7 +353,7 @@ t.test('Worker setup - Handle callback before functions', t => {
let setupCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -405,7 +408,7 @@ t.test('Worker setup - Handle callback before functions that throw errors', t =>
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -456,7 +459,7 @@ t.test('Worker setup - Handle promise before functions that resolve', t => {
let setupCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -511,7 +514,7 @@ t.test('Worker setup - Handle promise before functions that reject', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -562,7 +565,7 @@ t.test('Worker setup - Handle callback after functions', t => {
let setupCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -617,7 +620,7 @@ t.test('Worker setup - Handle callback after functions that throw errors', t =>
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -668,7 +671,7 @@ t.test('Worker setup - Handle promise after functions that resolve', t => {
let setupCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down Expand Up @@ -723,7 +726,7 @@ t.test('Worker setup - Handle promise after functions that reject', t => {
let mainCalls = 0
const notifier = t.captureFn(() => {})

function main() {
function main(): void {
mainCalls++
}

Expand Down

0 comments on commit 23cf1a7

Please sign in to comment.