import {expect, test} from 'vitest'; import gather from './gather.js'; import First from './gather-test/first.js'; import Second from './gather-test/second.js'; test('gathers', async () => { const Gathered = gather( import.meta.glob('./gather-test/*.js', {eager: true, import: 'default'}), {mapperForPath: (path) => path.replace(/\.\/gather-test\/(.*)\.js/, '$1')}, ); expect(Gathered.First) .to.equal(First); expect(Gathered.Second) .to.equal(Second); });