to-absolute-path.test.js (1017B)
1 // import expect from 'expect'; 2 3 // // Setup environment 4 // if ( 'object' !== typeof process ) process = {}; 5 // if (!process.env) process.env = {}; 6 // process.env.TEST = true; 7 // const approot = '' + require('app-root-path'), 8 // path = require('path'), 9 // urlParse = require('url-parse'); 10 11 // // Load extends 12 // expect.extend(require('jest-isa')); 13 14 // // Load our module 15 // let toAbsolutePath = require('./to-absolute-path'); 16 17 // test('Ensure toAbsolutePath is a function', async () => { 18 // expect(toAbsolutePath).toBeDefined(); // Basics 19 // expect(toAbsolutePath).isA(Function); 20 // }); 21 22 // test('Test some paths', async () => { 23 // let cases = [ 24 // ['file:///tmp', '/tmp'], 25 // ['/tmp', '/tmp'], 26 // ['file://tmp', approot + path.sep + 'tmp'], 27 // ['tmp', approot + path.sep + 'tmp'], 28 // ]; 29 30 // for ( let testCase of cases ) { 31 // expect(toAbsolutePath(testCase[0])).toBe(testCase[1]); 32 // expect(toAbsolutePath(urlParse(testCase[0]))).toBe(testCase[1]); 33 // } 34 // });