@@ -26,6 +26,7 @@ const TITLE = Buffer.from(
26
26
const REPORTER_CHOICES = [
27
27
{
28
28
name : '@japa/spec-reporter' as const ,
29
+ version : '1.3.3' ,
29
30
hint : '(Spec reporter)' ,
30
31
importCall ( ) {
31
32
return `import { specReporter } from '${ this . name } '`
@@ -41,6 +42,7 @@ const ASSERTION_CHOICES = [
41
42
{
42
43
name : '@japa/assert' as const ,
43
44
hint : '(Chai.js assert)' ,
45
+ version : '1.4.1' ,
44
46
importCall ( ) {
45
47
return `import { assert } from '${ this . name } '`
46
48
} ,
@@ -60,6 +62,7 @@ const ASSERTION_CHOICES = [
60
62
{
61
63
name : '@japa/expect' as const ,
62
64
hint : '(Jest expect)' ,
65
+ version : '2.0.2' ,
63
66
types : {
64
67
importCall ( ) {
65
68
return ''
@@ -86,6 +89,7 @@ const ADDITIONAL_PLUGINS = [
86
89
{
87
90
name : '@japa/run-failed-tests' as const ,
88
91
hint : '(A plugin to run only failed tests)' ,
92
+ version : '1.1.1' ,
89
93
importCall ( ) {
90
94
return `import { runFailedTests } from '${ this . name } '`
91
95
} ,
@@ -97,6 +101,7 @@ const ADDITIONAL_PLUGINS = [
97
101
{
98
102
name : '@japa/api-client' as const ,
99
103
hint : '(A plugin to test API endpoints over HTTP)' ,
104
+ version : '1.4.4' ,
100
105
importCall ( ) {
101
106
return `import { apiClient } from '${ this . name } '`
102
107
} ,
@@ -207,7 +212,7 @@ export async function setup() {
207
212
const tsContextProperties : string [ ] = [ ]
208
213
const tsTestProperties : string [ ] = [ ]
209
214
const tsImports : string [ ] = [ `import '@japa/runner'` ]
210
- const packagesToInstall : string [ ] = [ '@japa/runner' ]
215
+ const packagesToInstall : string [ ] = [ '@japa/runner@1.2.0 ' ]
211
216
212
217
const testFileName = `bin/test.${ fileExtension } `
213
218
const typesFileName = 'bin/japa_types.ts'
@@ -225,7 +230,7 @@ export async function setup() {
225
230
*/
226
231
reporters . forEach ( ( reporter ) => {
227
232
const reporterMatch = REPORTER_CHOICES . find ( ( { name } ) => name === reporter ) !
228
- packagesToInstall . push ( reporter )
233
+ packagesToInstall . push ( ` ${ reporterMatch . name } @ ${ reporterMatch . version } ` )
229
234
imports . push (
230
235
projectType === 'JavaScript' ? reporterMatch . requireCall ( ) : reporterMatch . importCall ( )
231
236
)
@@ -237,7 +242,7 @@ export async function setup() {
237
242
*/
238
243
if ( assertionLibrary !== 'None' ) {
239
244
const assertionMatch = ASSERTION_CHOICES . find ( ( { name } ) => name === assertionLibrary ) !
240
- packagesToInstall . push ( assertionLibrary )
245
+ packagesToInstall . push ( ` ${ assertionMatch . name } @ ${ assertionMatch . version } ` )
241
246
imports . push (
242
247
projectType === 'JavaScript' ? assertionMatch . requireCall ! ( ) : assertionMatch . importCall ! ( )
243
248
)
@@ -264,7 +269,7 @@ export async function setup() {
264
269
*/
265
270
plugins . forEach ( ( plugin ) => {
266
271
const promptMatch = ADDITIONAL_PLUGINS . find ( ( { name } ) => name === plugin ) !
267
- packagesToInstall . push ( plugin )
272
+ packagesToInstall . push ( ` ${ promptMatch . name } @ ${ promptMatch . version } ` )
268
273
imports . push (
269
274
projectType === 'JavaScript' ? promptMatch . requireCall ( ) : promptMatch . importCall ( )
270
275
)
0 commit comments