本文整理汇总了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();
});