This repository was archived by the owner on Jan 14, 2019. It is now read-only.
File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
import glob from 'glob' ;
2
+ import fs from 'fs' ;
2
3
import path from 'path' ;
3
4
4
5
export interface CreateFixturePatternConfig {
@@ -18,6 +19,8 @@ export interface FixturePatternConfig {
18
19
ignoreSourceType : boolean ;
19
20
}
20
21
22
+ const fixturesDirPath = path . join ( __dirname , '../fixtures' ) ;
23
+
21
24
export class FixturesTester {
22
25
protected babelFixtures : FixturePatternConfig [ ] = [ ] ;
23
26
protected espreeFixtures : FixturePatternConfig [ ] = [ ] ;
@@ -28,6 +31,10 @@ export class FixturesTester {
28
31
fixturesSubPath : string ,
29
32
config : CreateFixturePatternConfig = { }
30
33
) {
34
+ if ( ! fs . existsSync ( path . join ( fixturesDirPath , fixturesSubPath ) ) ) {
35
+ throw new Error ( `Registered path '${ path . join ( __dirname , fixturesSubPath ) } ' was not found` ) ;
36
+ }
37
+
31
38
const ignoreBabel = config . ignoreBabel || [ ] ;
32
39
const ignoreEspree = config . ignoreEspree || [ ] ;
33
40
const fileType = config . fileType || 'js' ;
@@ -63,8 +70,6 @@ export class FixturesTester {
63
70
}
64
71
65
72
protected processFixtures ( fixtures : FixturePatternConfig [ ] ) : Fixture [ ] {
66
- const fixturesDirPath = path . join ( __dirname , '../fixtures' ) ;
67
-
68
73
return fixtures
69
74
. map ( fixtures => {
70
75
return glob
You can’t perform that action at this time.
0 commit comments