11'use strict' ;
22
3- import '../src' ;
43import fs from 'fs'
54import path from 'path'
65import { equal } from 'assert' ;
76
7+ import hook from '../src' ;
8+
89const pipelines = {
910 'test-cases' : undefined ,
1011 'cssi' : [ ]
@@ -16,7 +17,8 @@ Object.keys(pipelines).forEach(dirname => {
1617
1718 fs . readdirSync ( testDir ) . forEach ( testCase => {
1819 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 ] } ) ;
2022 let expectedTokens = JSON . parse ( fs . readFileSync ( path . join ( testDir , testCase , 'expected.json' ) , 'utf-8' ) ) ;
2123 let tokens = require ( `${ testDir } /${ testCase } /source.css` ) ;
2224
@@ -34,7 +36,8 @@ describe( 'multiple sources', () => {
3436 let dirname = 'test-cases' ;
3537
3638 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 ] } ) ;
3841 let expectedTokens = JSON . parse ( fs . readFileSync ( path . join ( testDir , testCase , 'expected.json' ) , 'utf-8' ) ) ;
3942 let tokens1 = require ( `${ testDir } /${ testCase } /source1.css` ) ;
4043 let tokens2 = require ( `${ testDir } /${ testCase } /source2.css` ) ;
0 commit comments