Skip to content

Commit ad12897

Browse files
committed
test: fix breaking tests
1 parent 2f5068f commit ad12897

File tree

5 files changed

+31
-66
lines changed

5 files changed

+31
-66
lines changed

npm-audit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ <h5 class="card-title">
5555
<div class="card">
5656
<div class="card-body">
5757
<h5 class="card-title">
58-
October 4th 2020, 10:11:37 am
58+
October 4th 2020, 10:28:54 am
5959
</h5>
6060
<p class="card-text">Last updated</p>
6161
</div>

package-lock.json

Lines changed: 0 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"np": "^6.5.0",
6565
"npm-audit-html": "^1.4.3",
6666
"prettier": "^2.1.2",
67-
"ts-node": "^9.0.0",
6867
"typescript": "^4.0.3"
6968
},
7069
"nyc": {
@@ -108,7 +107,7 @@
108107
"picomatch": "^2.2.2",
109108
"slash": "^3.0.0"
110109
},
111-
"publishConfig": {
110+
"publishConfig": {
112111
"access": "public",
113112
"tag": "next"
114113
}

test-helpers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export const info = process.env.CI ? '[ info ]' : '[ blue(info) ]'
1515
export const success = process.env.CI ? '[ success ]' : '[ green(success) ]'
1616
export const error = process.env.CI ? '[ error ]' : '[ red(error) ]'
1717
export const warning = process.env.CI ? '[ warn ]' : '[ yellow(warn) ]'
18+
export const dimYellow = (value: string) => `dim(yellow(${value}))`

test/compiler.spec.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Filesystem } from '@poppinss/dev-utils'
1414
import { instantiate } from '@poppinss/cliui/build/api'
1515

1616
import { Compiler } from '../src/Compiler'
17-
import { success, info, warning, error } from '../test-helpers'
17+
import { success, info, warning, error, dimYellow } from '../test-helpers'
1818

1919
const ui = instantiate(true)
2020
const fs = new Filesystem(join(__dirname, '__app'))
@@ -72,19 +72,19 @@ test.group('Compiler', (group) => {
7272

7373
assert.deepEqual(ui.testingRenderer.logs, [
7474
{
75-
message: `${info} cleaning up dim(yellow("./build")) directory`,
75+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
7676
stream: 'stdout',
7777
},
7878
{
7979
message: `${info} compiling typescript source files`,
8080
stream: 'stdout',
8181
},
8282
{
83-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build)) }`,
83+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build')} }`,
8484
stream: 'stdout',
8585
},
8686
{
87-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
87+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
8888
stream: 'stdout',
8989
},
9090
{
@@ -136,19 +136,19 @@ test.group('Compiler', (group) => {
136136
assert.deepEqual(hasFiles, [true, true, true, true])
137137
assert.deepEqual(ui.testingRenderer.logs, [
138138
{
139-
message: `${info} cleaning up dim(yellow("./build")) directory`,
139+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
140140
stream: 'stdout',
141141
},
142142
{
143143
message: `${info} compiling typescript source files`,
144144
stream: 'stdout',
145145
},
146146
{
147-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build)) }`,
147+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build')} }`,
148148
stream: 'stdout',
149149
},
150150
{
151-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
151+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
152152
stream: 'stdout',
153153
},
154154
{
@@ -199,19 +199,19 @@ test.group('Compiler', (group) => {
199199
assert.deepEqual(hasFiles, [true, true, true, true])
200200
assert.deepEqual(ui.testingRenderer.logs, [
201201
{
202-
message: `${info} cleaning up dim(yellow("./build")) directory`,
202+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
203203
stream: 'stdout',
204204
},
205205
{
206206
message: `${info} compiling typescript source files`,
207207
stream: 'stdout',
208208
},
209209
{
210-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build)) }`,
210+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build')} }`,
211211
stream: 'stdout',
212212
},
213213
{
214-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
214+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
215215
stream: 'stdout',
216216
},
217217
{
@@ -262,19 +262,19 @@ test.group('Compiler', (group) => {
262262
assert.deepEqual(hasFiles, [true, true, true, true])
263263
assert.deepEqual(ui.testingRenderer.logs, [
264264
{
265-
message: `${info} cleaning up dim(yellow("./build/dist")) directory`,
265+
message: `${info} cleaning up ${dimYellow('"./build/dist"')} directory`,
266266
stream: 'stdout',
267267
},
268268
{
269269
message: `${info} compiling typescript source files`,
270270
stream: 'stdout',
271271
},
272272
{
273-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build/dist)) }`,
273+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build/dist')} }`,
274274
stream: 'stdout',
275275
},
276276
{
277-
message: `${info} copy { dim(yellow(.adonisrc.json => build/dist)) }`,
277+
message: `${info} copy { ${dimYellow('.adonisrc.json => build/dist')} }`,
278278
stream: 'stdout',
279279
},
280280
{
@@ -375,7 +375,7 @@ test.group('Compiler', (group) => {
375375

376376
assert.deepEqual(ui.testingRenderer.logs, [
377377
{
378-
message: `${info} cleaning up dim(yellow("./build/dist")) directory`,
378+
message: `${info} cleaning up ${dimYellow('"./build/dist"')} directory`,
379379
stream: 'stdout',
380380
},
381381
{
@@ -387,11 +387,11 @@ test.group('Compiler', (group) => {
387387
stream: 'stderr',
388388
},
389389
{
390-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build/dist)) }`,
390+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build/dist')} }`,
391391
stream: 'stdout',
392392
},
393393
{
394-
message: `${info} copy { dim(yellow(.adonisrc.json => build/dist)) }`,
394+
message: `${info} copy { ${dimYellow('.adonisrc.json => build/dist')} }`,
395395
stream: 'stdout',
396396
},
397397
{
@@ -444,7 +444,7 @@ test.group('Compiler', (group) => {
444444

445445
assert.deepEqual(ui.testingRenderer.logs, [
446446
{
447-
message: `${info} cleaning up dim(yellow("./build/dist")) directory`,
447+
message: `${info} cleaning up ${dimYellow('"./build/dist"')} directory`,
448448
stream: 'stdout',
449449
},
450450
{
@@ -517,19 +517,21 @@ test.group('Compiler', (group) => {
517517
assert.deepEqual(hasFiles, [true, true, true, true])
518518
assert.deepEqual(ui.testingRenderer.logs, [
519519
{
520-
message: `${info} cleaning up dim(yellow("./build")) directory`,
520+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
521521
stream: 'stdout',
522522
},
523523
{
524524
message: `${info} compiling typescript source files`,
525525
stream: 'stdout',
526526
},
527527
{
528-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace,package.json,package-lock.json => build)) }`,
528+
message: `${info} copy { ${dimYellow(
529+
'public/**/*.(js|css),ace,package.json,package-lock.json => build'
530+
)} }`,
529531
stream: 'stdout',
530532
},
531533
{
532-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
534+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
533535
stream: 'stdout',
534536
},
535537
{
@@ -587,19 +589,19 @@ test.group('Compiler', (group) => {
587589
assert.deepEqual(hasFiles, [true, true, true, true, true])
588590
assert.deepEqual(ui.testingRenderer.logs, [
589591
{
590-
message: `${info} cleaning up dim(yellow("./build")) directory`,
592+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
591593
stream: 'stdout',
592594
},
593595
{
594596
message: `${info} compiling typescript source files`,
595597
stream: 'stdout',
596598
},
597599
{
598-
message: `${info} copy { dim(yellow(public/**/*.(js|css),ace => build)) }`,
600+
message: `${info} copy { ${dimYellow('public/**/*.(js|css),ace => build')} }`,
599601
stream: 'stdout',
600602
},
601603
{
602-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
604+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
603605
stream: 'stdout',
604606
},
605607
{
@@ -650,19 +652,19 @@ test.group('Compiler', (group) => {
650652
assert.deepEqual(hasFiles, [true, false, true])
651653
assert.deepEqual(ui.testingRenderer.logs, [
652654
{
653-
message: `${info} cleaning up dim(yellow("./build")) directory`,
655+
message: `${info} cleaning up ${dimYellow('"./build"')} directory`,
654656
stream: 'stdout',
655657
},
656658
{
657659
message: `${info} compiling typescript source files`,
658660
stream: 'stdout',
659661
},
660662
{
661-
message: `${info} copy { dim(yellow(ace => build)) }`,
663+
message: `${info} copy { ${dimYellow('ace => build')} }`,
662664
stream: 'stdout',
663665
},
664666
{
665-
message: `${info} copy { dim(yellow(.adonisrc.json => build)) }`,
667+
message: `${info} copy { ${dimYellow('.adonisrc.json => build')} }`,
666668
stream: 'stdout',
667669
},
668670
{

0 commit comments

Comments
 (0)