Skip to content

Commit 7d40a71

Browse files
committed
chore: remove unneeded dependencies
1 parent d83cb7d commit 7d40a71

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

modules/core/reporters/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import ms from 'ms'
10+
import string from '@poppinss/string'
1111
import { ErrorsPrinter } from '@japa/errors-printer'
1212

1313
import { type Emitter, type Runner } from '../main.js'
@@ -85,7 +85,7 @@ export abstract class BaseReporter {
8585
},
8686
{
8787
key: colors.dim('Time'),
88-
value: colors.dim(ms(summary.duration)),
88+
value: colors.dim(string.milliseconds.format(summary.duration)),
8989
},
9090
]
9191
})

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@
4242
"@poppinss/ts-exec": "^1.4.1",
4343
"@release-it/conventional-changelog": "^10.0.3",
4444
"@types/chai": "^5.2.3",
45-
"@types/ms": "^2.1.0",
4645
"@types/node": "^25.0.1",
4746
"c8": "^10.1.3",
4847
"chai": "^6.2.1",
4948
"cross-env": "^10.1.0",
5049
"del-cli": "^7.0.0",
5150
"eslint": "^9.39.2",
52-
"glob": "^13.0.0",
5351
"prettier": "^3.7.4",
5452
"release-it": "^19.1.0",
5553
"serialize-error": "^12.0.0",
@@ -66,8 +64,6 @@
6664
"fast-glob": "^3.3.3",
6765
"find-cache-directory": "^6.0.0",
6866
"getopts": "^2.3.0",
69-
"ms": "^2.1.3",
70-
"slash": "^5.1.0",
7167
"supports-color": "^10.2.2"
7268
},
7369
"homepage": "https://github.com/japa/runner#readme",

src/files_manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import slash from 'slash'
10+
import string from '@poppinss/string'
1111
import fastGlob from 'fast-glob'
1212
import { pathToFileURL } from 'node:url'
1313
import type { TestFiles } from './types.js'
@@ -47,7 +47,7 @@ export class FilesManager {
4747
*/
4848
grep(files: URL[], filters: string[]): URL[] {
4949
return files.filter((file) => {
50-
const filename = slash(file.pathname)
50+
const filename = string.toUnixSlash(file.pathname)
5151
const filenameWithoutTestSuffix = filename.replace(FILE_SUFFIX_EXPRESSION, '')
5252

5353
return !!filters.find((filter) => {

src/reporters/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import slash from 'slash'
1110
import { relative } from 'node:path'
11+
import string from '@poppinss/string'
1212
import { stripVTControlCharacters } from 'node:util'
1313
import { ErrorsPrinter } from '@japa/errors-printer'
1414
import { BaseReporter } from '../../modules/core/main.js'
@@ -80,7 +80,7 @@ export class GithubReporter extends BaseReporter {
8080
return this.formatMessage({
8181
command: 'error',
8282
properties: {
83-
file: slash(relative(process.cwd(), mainFrame.fileName!)),
83+
file: string.toUnixSlash(relative(process.cwd(), mainFrame.fileName!)),
8484
title: error.title,
8585
line: String(mainFrame.lineNumber!),
8686
column: String(mainFrame.columnNumber!),

src/reporters/spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* file that was distributed with this source code.
88
*/
99

10-
import ms from 'ms'
10+
import string from '@poppinss/string'
1111
import { relative } from 'node:path'
1212

1313
import { colors, icons } from '../helpers.js'
@@ -117,7 +117,9 @@ export class SpecReporter extends BaseReporter {
117117
const message = this.#getTestMessage(payload)
118118
const prefix = payload.isPinned ? colors.yellow('[PINNED] ') : ''
119119
const indentation = this.currentFileName || this.currentGroupName ? ' ' : ''
120-
const duration = colors.dim(`(${ms(Number(payload.duration.toFixed(2)))})`)
120+
const duration = colors.dim(
121+
`(${string.milliseconds.format(Number(payload.duration.toFixed(2)))})`
122+
)
121123
const retries =
122124
payload.retryAttempt && payload.retryAttempt > 1
123125
? colors.dim(`(x${payload.retryAttempt}) `)

0 commit comments

Comments
 (0)