refactor: convert all fs methods to async (#6725)

* refactor: convert all fs methods to async

* fix snap
This commit is contained in:
Joshua Chen 2022-02-20 10:21:33 +08:00 committed by GitHub
parent c0b3c9af65
commit c6d0d812eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 518 additions and 429 deletions

View file

@ -19,6 +19,7 @@ const dogfoodingPluginInstances = [
// Using a symlinked folder as source, test for use-case https://github.com/facebook/docusaurus/issues/3272
// The target folder uses a _ prefix to test against an edge case regarding MDX partials: https://github.com/facebook/docusaurus/discussions/5181#discussioncomment-1018079
// eslint-disable-next-line no-restricted-properties
path: fs.realpathSync('_dogfooding/docs-tests-symlink'),
showLastUpdateTime: true,
sidebarItemsGenerator(args) {

View file

@ -49,7 +49,7 @@ expect.extend({
describe('users', () => {
sortedUsers.forEach((user) => {
test(user.title, () => {
test(user.title, async () => {
Joi.attempt(
user,
Joi.object<User>({
@ -86,6 +86,7 @@ describe('users', () => {
});
const imageDir = path.join(__dirname, '../showcase');
// eslint-disable-next-line no-restricted-properties
const files = fs
.readdirSync(imageDir)
.filter((file) => ['.png', 'jpg', '.jpeg'].includes(path.extname(file)));