-
Notifications
You must be signed in to change notification settings - Fork 4k
/
index.js
34 lines (28 loc) · 905 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* External dependencies
*/
const path = require( 'path' );
const { promisify } = require( 'util' );
const webpack = promisify( require( 'webpack' ) );
const fs = require( 'fs' );
const access = promisify( fs.access );
const unlink = promisify( fs.unlink );
/**
* Internal dependencies
*/
const config = require( './fixtures/webpack.config.js' );
const CustomTemplatedPathPlugin = require( '../' );
describe( 'CustomTemplatedPathPlugin', () => {
const outputFile = path.join( __dirname, '/fixtures/entry.js' )
beforeAll( async () => {
// Remove output file so as not to report false positive from previous
// test. Absorb error since the file may not exist (unlink will throw).
try {
await unlink( outputFile );
} catch ( error ) {}
} );
it( 'should resolve with basename output', async () => {
const stats = await webpack( config );
await access( outputFile );
} );
} );