11/* eslint no-unused-vars: 0 */
2+ import mock from 'mock-fs' ;
3+ import path from 'path' ;
4+ import { mockRepo } from '../utils.js' ;
5+ import parse from '../../src/parsers/javascript.js' ;
6+ import github from '../../src/github.js' ;
7+ import { fileURLToPath } from 'url' ;
28
3- const mock = require ( 'mock-fs' ) ;
4- const path = require ( 'path' ) ;
5- const mockRepo = require ( '../utils' ) . mockRepo ;
6- const parse = require ( '../../src/parsers/javascript' ) ;
7- const github = require ( '../../src/github' ) ;
9+ const __filename = fileURLToPath ( import . meta. url ) ;
10+ const __dirname = path . dirname ( __filename ) ;
811
912// mock-fs is causing some unusual side effects with jest-resolve
1013// not being able to resolve modules so we've disabled these tests
@@ -29,15 +32,15 @@ function evaluate(fn) {
2932 ) ;
3033}
3134
32- afterEach ( function ( ) {
35+ afterEach ( function ( ) {
3336 mock . restore ( ) ;
3437} ) ;
3538
36- test . skip ( 'github' , function ( ) {
39+ test . skip ( 'github' , function ( ) {
3740 mock ( mockRepo . master ) ;
3841
3942 expect (
40- evaluate ( function ( ) {
43+ evaluate ( function ( ) {
4144 /**
4245 * get one
4346 * @returns {number } one
@@ -52,11 +55,11 @@ test.skip('github', function() {
5255 } ) ;
5356} ) ;
5457
55- test . skip ( 'malformed repository' , function ( ) {
58+ test . skip ( 'malformed repository' , function ( ) {
5659 mock ( mockRepo . malformed ) ;
5760
5861 expect (
59- evaluate ( function ( ) {
62+ evaluate ( function ( ) {
6063 /**
6164 * get one
6265 * @returns {number } one
@@ -68,11 +71,11 @@ test.skip('malformed repository', function() {
6871 ) . toBe ( undefined ) ;
6972} ) ;
7073
71- test . skip ( 'enterprise repository' , function ( ) {
74+ test . skip ( 'enterprise repository' , function ( ) {
7275 mock ( mockRepo . enterprise ) ;
7376
7477 expect (
75- evaluate ( function ( ) {
78+ evaluate ( function ( ) {
7679 /**
7780 * get one
7881 * @returns {number } one
@@ -83,16 +86,15 @@ test.skip('enterprise repository', function() {
8386 } ) [ 0 ] . context . github
8487 ) . toEqual ( {
8588 path : 'index.js' ,
86- url :
87- 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8'
89+ url : 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8'
8890 } ) ;
8991} ) ;
9092
91- test . skip ( 'typedef' , function ( ) {
93+ test . skip ( 'typedef' , function ( ) {
9294 mock ( mockRepo . master ) ;
9395
9496 expect (
95- evaluate ( function ( ) {
97+ evaluate ( function ( ) {
9698 /**
9799 * A number, or a string containing a number.
98100 * @typedef {(number|string) } NumberLike
0 commit comments