Skip to content

Commit 8d8c27b

Browse files
author
Dane Pilcher
committed
test: fix windows mock fs
1 parent 50e0ce2 commit 8d8c27b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/amplify-codegen/tests/commands/mock-fs-setup.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ function setupMocks(mockFs, loadConfig, apiId, frontend, target, generatedFileNa
1818
const schemaFilePath = 'schema.json';
1919
const nodeModulesPrettierGraphqlGenerator = path.resolve(path.join(__dirname, '../../../graphql-generator/node_modules/prettier'));
2020
const nodeModulesPrettierTypesGenerator = path.resolve(path.join(__dirname, '../../../graphql-types-generator/node_modules/prettier'));
21+
const nodeModulesPrettierGraphqlGeneratorWindows = path.resolve(
22+
path.join(__dirname, '../../../../node_modules/@aws-amplify/graphql-generator/node_modules/prettier'),
23+
);
24+
const nodeModulesPrettierTypesGeneratorWindows = path.resolve(
25+
path.join(__dirname, '../../../../node_modules/@aws-amplify/graphql-generator/node_modules/prettier'),
26+
);
27+
28+
const nodeModulesPrettier = path.resolve(path.join(__dirname, '../../../../node_modules/prettier'));
2129
const mockedFiles = {
2230
// load actual prettier module to avoid error
2331
// Cannot find module './parser-graphql' from '../../node_modules/prettier/index.js'
@@ -30,6 +38,14 @@ function setupMocks(mockFs, loadConfig, apiId, frontend, target, generatedFileNa
3038
recursive: true,
3139
lazy: true,
3240
}),
41+
[nodeModulesPrettierGraphqlGeneratorWindows]: mockFs.load(nodeModulesPrettierGraphqlGenerator, {
42+
recursive: true,
43+
lazy: true,
44+
}),
45+
[nodeModulesPrettierTypesGeneratorWindows]: mockFs.load(nodeModulesPrettierTypesGenerator, {
46+
recursive: true,
47+
lazy: true,
48+
}),
3349
[schemaFilePath]: mockFs.load(path.resolve(path.join(__dirname, './blog-introspection-schema.json'))),
3450
...extendMockFs,
3551
};

0 commit comments

Comments
 (0)