Skip to content

Commit 9d20b1e

Browse files
committed
Add tests for copying files without ext to directory
1 parent 5fd2f16 commit 9d20b1e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/copy.test.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import fsFixtures from './utils/fs-fixtures';
1111
import FileManagerPlugin from '../lib';
1212

1313
const fixturesDir = path.resolve(__dirname, 'fixtures');
14-
const { existsSync } = fsFixtures(fixturesDir);
14+
const { existsSync, writeFile } = fsFixtures(fixturesDir);
1515

1616
test.before(async () => {
1717
await del('*', {
@@ -136,6 +136,24 @@ test('should first create destination if it does not exist and copy inside desti
136136
t.pass();
137137
});
138138

139+
test('should copy a file without extension to target folder', async (t) => {
140+
await writeFile('testing/file-without-ext');
141+
142+
const config = {
143+
onEnd: {
144+
copy: [{ source: 'testing/file-without-ext', destination: './testing/no-ext/' }],
145+
},
146+
};
147+
148+
const compiler = getCompiler(fixturesDir);
149+
new FileManagerPlugin(config).apply(compiler);
150+
await compile(compiler);
151+
152+
const result = existsSync('./testing/no-ext/file-without-ext');
153+
t.true(result);
154+
t.pass();
155+
});
156+
139157
test('should not copy a file that does not exist { source: "/filedoesnotexist.js", destination: "/destFolder" } provided', async (t) => {
140158
const config = {
141159
onEnd: {

0 commit comments

Comments
 (0)