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 3
3
import assert from "assert" ;
4
4
import preset from "../src/index" ;
5
5
import { TextLintCore } from "textlint" ;
6
+ import path from "path" ;
6
7
import fs from "fs" ;
7
8
8
9
describe ( "fixer-test" , function ( ) {
9
10
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" ) ;
11
12
const textlint = new TextLintCore ( ) ;
12
13
// all true
13
14
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 ) => {
15
16
assert . equal ( result . remainingMessages . length , 0 ) ;
16
17
const inputs = result . output . split ( "\n" ) ;
17
18
const outputs = expected . split ( "\n" ) ;
18
19
for ( var i = 0 ; i < inputs . length ; i ++ ) {
19
20
const input = inputs [ i ] ;
20
21
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
+ ) ;
22
31
}
23
32
} ) ;
24
33
} ) ;
You can’t perform that action at this time.
0 commit comments