Skip to content

Commit

Permalink
Add tests for async bundle transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
caccialdo committed Jul 7, 2017
1 parent 4980d71 commit a76b35e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/function/bundle-transformer-async/_config.js
@@ -0,0 +1,22 @@
module.exports = {
description: 'bundle transformers can be asynchronous',
options: {
plugins: [
{
transformBundle: function ( code ) {
return Promise.resolve( code.replace( 'x', 1 ) );
}
},
{
transformBundle: function ( code ) {
return code.replace( '1', 2 );
}
},
{
transformBundle: function ( code ) {
return Promise.resolve( code.replace( '2', 3 ) );
}
}
]
}
};
1 change: 1 addition & 0 deletions test/function/bundle-transformer-async/main.js
@@ -0,0 +1 @@
assert.equal( x, 3 );

0 comments on commit a76b35e

Please sign in to comment.