1
+ /* eslint-disable @typescript-eslint/no-var-requires */
1
2
import { options , bold , red , gray , yellow } from 'colorette'
2
3
3
4
beforeEach ( ( ) => {
4
- jest . resetModules ( ) ;
5
+ jest . resetModules ( )
5
6
jest . doMock ( 'fs' , ( ) => ( { } ) )
6
7
jest . doMock ( 'colorette' , ( ) => ( { options, bold, red, gray, yellow } ) )
7
- } ) ;
8
+ } )
8
9
9
10
afterEach ( ( ) => {
10
11
options . enabled = true
11
12
} )
12
13
13
14
it ( 'shows code with colors (default)' , ( ) => {
14
- let postcss = require ( '../lib/postcss.js' ) ;
15
+ let postcss = require ( '../lib/postcss.js' )
15
16
16
17
let error
17
18
try {
@@ -35,7 +36,7 @@ it('shows code with colors (default)', () => {
35
36
} )
36
37
37
38
it ( 'shows code without colors (default)' , ( ) => {
38
- let postcss = require ( '../lib/postcss.js' ) ;
39
+ let postcss = require ( '../lib/postcss.js' )
39
40
40
41
let error
41
42
options . enabled = false
@@ -53,7 +54,7 @@ it('shows code without colors (default)', () => {
53
54
} )
54
55
55
56
it ( 'shows code without colors (setting)' , ( ) => {
56
- let postcss = require ( '../lib/postcss.js' ) ;
57
+ let postcss = require ( '../lib/postcss.js' )
57
58
58
59
let error
59
60
try {
@@ -69,7 +70,7 @@ it('shows code without colors (setting)', () => {
69
70
} )
70
71
71
72
it ( 'generates source map without fs' , ( ) => {
72
- let postcss = require ( '../lib/postcss.js' ) ;
73
+ let postcss = require ( '../lib/postcss.js' )
73
74
74
75
expect (
75
76
postcss ( [ ( ) => { } ] ) . process ( 'a{}' , { from : 'a.css' , map : true } ) . css
@@ -82,8 +83,8 @@ it('generates source map without fs', () => {
82
83
} )
83
84
84
85
it ( `doesn't throw error without path` , ( ) => {
85
- jest . doMock ( 'path' , ( ) => ( { } ) ) ;
86
- let postcss = require ( '../lib/postcss.js' ) ;
86
+ jest . doMock ( 'path' , ( ) => ( { } ) )
87
+ let postcss = require ( '../lib/postcss.js' )
87
88
88
89
expect (
89
90
postcss ( [ ( ) => { } ] ) . process ( 'a{}' , { from : 'a.css' , map : true } ) . css
0 commit comments