Oliver Eyton-Williams 108d2460e7
fix(tools): use correct superblock paths (#45285)
* fix: use array of choices

* fix: capture traces from fs promise errors

* fix: use helper to get superblock subpath
2022-03-07 10:51:33 +05:30

16 lines
536 B
TypeScript

import fs from 'fs/promises';
import path from 'path';
import { SuperBlocks } from '../../config/certification-settings';
import { getSuperBlockSubPath } from './fs-utils';
describe('getSuperBlockSubPath', () => {
it('should return sub-paths that exist', async () => {
const subPaths = Object.values(SuperBlocks).map(getSuperBlockSubPath);
const paths = subPaths.map(sub =>
path.resolve(__dirname, '../../curriculum/challenges/english', sub)
);
await Promise.all(paths.map(path => fs.access(path)));
});
});