本文整理匯總了TypeScript中temp-sandbox.getFileListSync函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getFileListSync函數的具體用法?TypeScript getFileListSync怎麽用?TypeScript getFileListSync使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了getFileListSync函數的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('does nothing when nothing changes or files added but not removed', async () => {
createSrcBundle(1);
createStaticFiles();
const cleanWebpackPlugin = new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: [],
});
const removeFilesSpy = jest.spyOn(cleanWebpackPlugin, 'removeFiles');
const compiler = webpack({
entry: entryFileFull,
output: {
path: outputPathFull,
filename: 'bundle.js',
chunkFilename: '[name].bundle.js',
},
plugins: [cleanWebpackPlugin],
});
expect(cleanWebpackPlugin.currentAssets).toEqual([]);
await compiler.run();
expect(cleanWebpackPlugin.currentAssets).toEqual(['bundle.js']);
await compiler.run();
expect(cleanWebpackPlugin.currentAssets).toEqual(['bundle.js']);
expect(sandbox.getFileListSync(outputPathFull)).toEqual([
'.hidden.file',
'bundle.js',
'static1.js',
'static2.txt',
]);
createSrcBundle(2);
await compiler.run();
expect(cleanWebpackPlugin.currentAssets).toEqual([
'1.bundle.js',
'bundle.js',
]);
expect(sandbox.getFileListSync(outputPathFull)).toEqual([
'.hidden.file',
'1.bundle.js',
'bundle.js',
'static1.js',
'static2.txt',
]);
expect(removeFilesSpy).not.toHaveBeenCalled();
});