diff --git a/packages/docusaurus/src/server/loadSetup.ts b/packages/docusaurus/src/server/loadSetup.ts new file mode 100644 index 0000000000..f148c0c9c2 --- /dev/null +++ b/packages/docusaurus/src/server/loadSetup.ts @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import path from 'path'; +import {load} from './index'; +import {Props} from '@docusaurus/types'; + +// Helper methods to setup dummy/fake projects +export const loadSetup = async (name: string): Promise => { + const fixtures = path.join(__dirname, '__tests__', '__fixtures__'); + const simpleSite = path.join(fixtures, 'simple-site'); + const customSite = path.join(fixtures, 'custom-site'); + + switch (name) { + case 'custom': + return load(customSite); + case 'simple': + default: + return load(simpleSite); + } +};