19 lines
477 B
JavaScript
19 lines
477 B
JavaScript
import {expect, test} from 'vitest';
|
|
|
|
import gather from './gather.js';
|
|
|
|
test('gathers', async () => {
|
|
const Gathered = gather(
|
|
import.meta.glob('./test/*.js', {eager: true, import: 'default'}),
|
|
{mapperForPath: (path) => path.replace(/\.\/test\/(.*)\.js/, '$1')},
|
|
);
|
|
expect(Gathered.First.key)
|
|
.to.equal('First');
|
|
expect(Gathered[1].id)
|
|
.to.equal(1);
|
|
expect(Gathered.Second.key)
|
|
.to.equal('Second');
|
|
expect(Gathered[2].id)
|
|
.to.equal(2);
|
|
});
|