1- var test = require ( "tape " )
1+ var test = require ( "ava " )
22var webpack = require ( "webpack" )
3- var assign = require ( "object-assign" )
43var conf = require ( "./utils/conf" )
54var fs = require ( "fs" )
65
76// clone the "fixable" file, so that we do not lose the original contents
87// when the fixes are applied to disk
9- test ( "setup" , function ( t ) {
8+ test . before ( function ( ) {
109 fs
1110 . createReadStream ( "./test/fixtures/fixable.js" )
1211 . pipe ( fs . createWriteStream ( "./test/fixtures/fixable-clone.js" ) )
13-
14- t . end ( )
1512} )
1613
17- test ( "loader doesn't throw error if file ok after auto-fixing" , function ( t ) {
18- webpack ( assign ( { } ,
19- conf ,
14+ test . cb ( "loader doesn't throw error if file ok after auto-fixing" ,
15+ function ( t ) {
16+ t . plan ( 2 )
17+ webpack ( conf (
2018 {
2119 entry : "./test/fixtures/fixable-clone.js" ,
2220 module : {
@@ -35,15 +33,14 @@ test("loader doesn't throw error if file ok after auto-fixing", function(t) {
3533 throw err
3634 }
3735 // console.log(stats.compilation.errors)
38- t . notOk ( stats . hasErrors ( ) , "a good file doesn't give any error" )
36+ t . false ( stats . hasErrors ( ) , "a good file doesn't give any error" )
3937 // console.log(stats.compilation.warnings)
40- t . notOk ( stats . hasWarnings ( ) , "a good file doesn't give any warning" )
38+ t . false ( stats . hasWarnings ( ) , "a good file doesn't give any warning" )
4139 t . end ( )
4240 } )
4341} )
4442
4543// remove the clone
46- test ( "teardown" , function ( t ) {
44+ test . after . always ( function ( ) {
4745 fs . unlinkSync ( "./test/fixtures/fixable-clone.js" )
48- t . end ( )
4946} )
0 commit comments