File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77const fs = require ( "fs" ) ;
88const path = require ( "path" ) ;
99
10- const EXPECTED_ERRORS = new Set (
11- process . platform === "win32" ? [ "EINVAL" , "ENOENT" , "UNKNOWN" ] : [ "EINVAL" ]
12- ) ;
10+ // macOS, Linux, and Windows all rely on these errors
11+ const EXPECTED_ERRORS = new Set ( [ "EINVAL" , "ENOENT" ] ) ;
12+
13+ // On Windows there is also this error in some cases
14+ if ( process . platform === "win32" ) EXPECTED_ERRORS . add ( "UNKNOWN" ) ;
1315
1416class LinkResolver {
1517 constructor ( ) {
Original file line number Diff line number Diff line change 1+ /*globals describe it beforeEach afterEach */
2+ "use strict" ;
3+
4+ const should = require ( "should" ) ;
5+ const LinkResolver = require ( "../lib/LinkResolver" ) ;
6+
7+ describe ( "LinkResolver" , ( ) => {
8+ it ( "should not throw when a path resolves with ENOENT" , ( ) => {
9+ const resolver = new LinkResolver ( ) ;
10+ const result = resolver . resolve ( "/path/to/nonexistent/file/or/folder" ) ;
11+ should . exist ( result ) ;
12+ } ) ;
13+ } ) ;
You can’t perform that action at this time.
0 commit comments