File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 33import assert from "assert" ;
44import preset from "../src/index" ;
55import { TextLintCore } from "textlint" ;
6+ import path from "path" ;
67import fs from "fs" ;
78
89describe ( "fixer-test" , function ( ) {
910 it ( "should convert expected" , function ( ) {
10- const expected = fs . readFileSync ( __dirname + "/fixtures/output.md" , "utf-8" ) ;
11+ const expected = fs . readFileSync ( path . join ( __dirname , "/fixtures/output.md" ) , "utf-8" ) ;
1112 const textlint = new TextLintCore ( ) ;
1213 // all true
1314 textlint . setupRules ( preset . rules ) ;
14- return textlint . fixFile ( __dirname + "/fixtures/input.md" ) . then ( ( result ) => {
15+ return textlint . fixFile ( path . join ( __dirname , "/fixtures/input.md" ) ) . then ( ( result ) => {
1516 assert . equal ( result . remainingMessages . length , 0 ) ;
1617 const inputs = result . output . split ( "\n" ) ;
1718 const outputs = expected . split ( "\n" ) ;
1819 for ( var i = 0 ; i < inputs . length ; i ++ ) {
1920 const input = inputs [ i ] ;
2021 const output = outputs [ i ] ;
21- assert . strictEqual ( input , output ) ;
22+ assert . strictEqual (
23+ input ,
24+ output ,
25+ `mismatch at line ${ i }
26+
27+ at ${ path . join ( __dirname , "/fixtures/input.md" ) } :${ i }
28+ at ${ path . join ( __dirname , "/fixtures/output.md" ) } :${ i }
29+ `
30+ ) ;
2231 }
2332 } ) ;
2433 } ) ;
You can’t perform that action at this time.
0 commit comments