Skip to content

Commit

Permalink
Add dynamic-import test
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Apr 16, 2019
1 parent 30aa120 commit 705e4e3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Webpack \`dynamic-import\` should produce expected output: Dependencies JSON should match snapshot 1`] = `
Array [
"lodash",
"wp-blob",
]
`;

exports[`Webpack \`dynamic-import\` should produce expected output: External modules should match snapshot 1`] = `
Array [
Object {
"externalType": "this",
"request": Object {
"this": Array [
"wp",
"blob",
],
},
"userRequest": "@wordpress/blob",
},
Object {
"externalType": "this",
"request": Object {
"this": "lodash",
},
"userRequest": "lodash",
},
]
`;

exports[`Webpack \`no-default\` should produce expected output: Dependencies JSON should match snapshot 1`] = `Array []`;

exports[`Webpack \`no-default\` should produce expected output: External modules should match snapshot 1`] = `Array []`;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* External dependencies
*/
import _ from 'lodash';

import( './util' ).then( _.noop );
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* WordPress dependencies
*/
import { isBlobURL } from '@wordpress/blob';

isBlobURL();
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const DependencyExtractionWebpackPlugin = require( '../../..' );

module.exports = {
plugins: [ new DependencyExtractionWebpackPlugin() ],
};

0 comments on commit 705e4e3

Please sign in to comment.