1
1
'use strict' ;
2
2
3
- import '../src' ;
4
3
import fs from 'fs'
5
4
import path from 'path'
6
5
import { equal } from 'assert' ;
7
6
7
+ import hook from '../src' ;
8
+
8
9
const pipelines = {
9
10
'test-cases' : undefined ,
10
11
'cssi' : [ ]
@@ -16,7 +17,8 @@ Object.keys(pipelines).forEach(dirname => {
16
17
17
18
fs . readdirSync ( testDir ) . forEach ( testCase => {
18
19
if ( fs . existsSync ( path . join ( testDir , testCase , 'source.css' ) ) ) {
19
- it ( 'should ' + testCase . replace ( / - / g, ' ' ) , done => {
20
+ it ( 'should ' + testCase . replace ( / - / g, ' ' ) , ( ) => {
21
+ hook ( { use : pipelines [ dirname ] } ) ;
20
22
let expectedTokens = JSON . parse ( fs . readFileSync ( path . join ( testDir , testCase , 'expected.json' ) , 'utf-8' ) ) ;
21
23
let tokens = require ( `${ testDir } /${ testCase } /source.css` ) ;
22
24
@@ -34,7 +36,8 @@ describe( 'multiple sources', () => {
34
36
let dirname = 'test-cases' ;
35
37
36
38
if ( fs . existsSync ( path . join ( testDir , testCase , 'source1.css' ) ) ) {
37
- it ( 'should ' + testCase . replace ( / - / g, ' ' ) , done => {
39
+ it ( 'should ' + testCase . replace ( / - / g, ' ' ) , ( ) => {
40
+ hook ( { use : pipelines [ dirname ] } ) ;
38
41
let expectedTokens = JSON . parse ( fs . readFileSync ( path . join ( testDir , testCase , 'expected.json' ) , 'utf-8' ) ) ;
39
42
let tokens1 = require ( `${ testDir } /${ testCase } /source1.css` ) ;
40
43
let tokens2 = require ( `${ testDir } /${ testCase } /source2.css` ) ;
0 commit comments