//something.spec.js
import { myCustomGlob } from './scripts/index'
describe.only('generate index', () => {
console.log(myCustomGlob) //MODULE NOT FONUD ERROR
})
//script
const fs = require('fs')
const myCustomGlob = () => {
//some fs operation
}
export {
myCustomGlob
}
I have a npm script that used glob and fs to generate some code to create a new file. But I want to write unit test for those function too, but I got MODULE 'fs' NOT FOUND error. why? I thought 'fs' is included since I import myCustomGlob?