File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ QUnit.module('codemod-cli', function(hooks) {
375375 } ,
376376 } ,
377377 } ) ;
378+
378379 userProject . write ( {
379380 foo : { 'something.js' : `let blah = "bar";` } ,
380381 } ) ;
@@ -392,6 +393,34 @@ QUnit.module('codemod-cli', function(hooks) {
392393 } ) ;
393394 } ) ;
394395
396+ QUnit . test ( 'can specify additional extensions to run against' , async function ( assert ) {
397+ codemodProject . write ( {
398+ transforms : {
399+ main : {
400+ 'index.js' : `
401+ module.exports = function transformer(file, api) {
402+ return file.source.toUpperCase();
403+ }
404+ ` ,
405+ } ,
406+ } ,
407+ } ) ;
408+
409+ userProject . write ( {
410+ foo : { 'something.hbs' : `<Foo />` } ,
411+ } ) ;
412+
413+ await CodemodCLI . runTransform ( codemodProject . path ( 'bin' ) , 'main' , [
414+ '--extensions' ,
415+ 'hbs' ,
416+ 'foo/**' ,
417+ ] ) ;
418+
419+ assert . deepEqual ( userProject . read ( ) , {
420+ foo : { 'something.hbs' : `<FOO />` } ,
421+ } ) ;
422+ } ) ;
423+
395424 QUnit . test ( 'runs transform against class syntax' , async function ( assert ) {
396425 userProject . write ( {
397426 foo : {
You can’t perform that action at this time.
0 commit comments