diff --git a/test/form/indent-false/_config.js b/test/form/indent-false/_config.js new file mode 100644 index 0000000..8db8ffd --- /dev/null +++ b/test/form/indent-false/_config.js @@ -0,0 +1,7 @@ +module.exports = { + description: 'does not indent with indent: false', + options: { + moduleName: 'foo', + indent: false + } +}; diff --git a/test/form/indent-false/_expected/amd.js b/test/form/indent-false/_expected/amd.js new file mode 100644 index 0000000..07c823c --- /dev/null +++ b/test/form/indent-false/_expected/amd.js @@ -0,0 +1,9 @@ +define(function () { 'use strict'; + +function foo () { + console.log( 'indented with tabs' ); +} + +return foo; + +}); diff --git a/test/form/indent-false/_expected/cjs.js b/test/form/indent-false/_expected/cjs.js new file mode 100644 index 0000000..7f6e0b9 --- /dev/null +++ b/test/form/indent-false/_expected/cjs.js @@ -0,0 +1,7 @@ +'use strict'; + +function foo () { + console.log( 'indented with tabs' ); +} + +module.exports = foo; diff --git a/test/form/indent-false/_expected/es6.js b/test/form/indent-false/_expected/es6.js new file mode 100644 index 0000000..d4b23ef --- /dev/null +++ b/test/form/indent-false/_expected/es6.js @@ -0,0 +1,5 @@ +function foo () { + console.log( 'indented with tabs' ); +} + +export default foo; diff --git a/test/form/indent-false/_expected/iife.js b/test/form/indent-false/_expected/iife.js new file mode 100644 index 0000000..df244ea --- /dev/null +++ b/test/form/indent-false/_expected/iife.js @@ -0,0 +1,9 @@ +var foo = (function () { 'use strict'; + +function foo () { + console.log( 'indented with tabs' ); +} + +return foo; + +})(); diff --git a/test/form/indent-false/_expected/umd.js b/test/form/indent-false/_expected/umd.js new file mode 100644 index 0000000..ad094b9 --- /dev/null +++ b/test/form/indent-false/_expected/umd.js @@ -0,0 +1,13 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.foo = factory(); +}(this, function () { 'use strict'; + +function foo () { + console.log( 'indented with tabs' ); +} + +return foo; + +})); diff --git a/test/form/indent-false/main.js b/test/form/indent-false/main.js new file mode 100644 index 0000000..10005f9 --- /dev/null +++ b/test/form/indent-false/main.js @@ -0,0 +1,3 @@ +export default function foo () { + console.log( 'indented with tabs' ); +} diff --git a/test/form/indent-true-spaces/_config.js b/test/form/indent-true-spaces/_config.js new file mode 100644 index 0000000..4777113 --- /dev/null +++ b/test/form/indent-true-spaces/_config.js @@ -0,0 +1,7 @@ +module.exports = { + description: 'auto-indents with spaces and indent: true', + options: { + moduleName: 'foo', + indent: true + } +}; diff --git a/test/form/indent-true-spaces/_expected/amd.js b/test/form/indent-true-spaces/_expected/amd.js new file mode 100644 index 0000000..2210188 --- /dev/null +++ b/test/form/indent-true-spaces/_expected/amd.js @@ -0,0 +1,9 @@ +define(function () { 'use strict'; + + function foo () { + console.log( 'indented with spaces' ); + } + + return foo; + +}); diff --git a/test/form/indent-true-spaces/_expected/cjs.js b/test/form/indent-true-spaces/_expected/cjs.js new file mode 100644 index 0000000..c4a9126 --- /dev/null +++ b/test/form/indent-true-spaces/_expected/cjs.js @@ -0,0 +1,7 @@ +'use strict'; + +function foo () { + console.log( 'indented with spaces' ); +} + +module.exports = foo; diff --git a/test/form/indent-true-spaces/_expected/es6.js b/test/form/indent-true-spaces/_expected/es6.js new file mode 100644 index 0000000..3263bb6 --- /dev/null +++ b/test/form/indent-true-spaces/_expected/es6.js @@ -0,0 +1,5 @@ +function foo () { + console.log( 'indented with spaces' ); +} + +export default foo; diff --git a/test/form/indent-true-spaces/_expected/iife.js b/test/form/indent-true-spaces/_expected/iife.js new file mode 100644 index 0000000..38cfb95 --- /dev/null +++ b/test/form/indent-true-spaces/_expected/iife.js @@ -0,0 +1,9 @@ +var foo = (function () { 'use strict'; + + function foo () { + console.log( 'indented with spaces' ); + } + + return foo; + +})(); diff --git a/test/form/indent-true-spaces/_expected/umd.js b/test/form/indent-true-spaces/_expected/umd.js new file mode 100644 index 0000000..ecbc24d --- /dev/null +++ b/test/form/indent-true-spaces/_expected/umd.js @@ -0,0 +1,13 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.foo = factory(); +}(this, function () { 'use strict'; + + function foo () { + console.log( 'indented with spaces' ); + } + + return foo; + +})); diff --git a/test/form/indent-true-spaces/main.js b/test/form/indent-true-spaces/main.js new file mode 100644 index 0000000..20f79c7 --- /dev/null +++ b/test/form/indent-true-spaces/main.js @@ -0,0 +1,3 @@ +export default function foo () { + console.log( 'indented with spaces' ); +} diff --git a/test/form/indent-true/_config.js b/test/form/indent-true/_config.js new file mode 100644 index 0000000..ce46054 --- /dev/null +++ b/test/form/indent-true/_config.js @@ -0,0 +1,7 @@ +module.exports = { + description: 'auto-indents with indent: true', + options: { + moduleName: 'foo', + indent: true + } +}; diff --git a/test/form/indent-true/_expected/amd.js b/test/form/indent-true/_expected/amd.js new file mode 100644 index 0000000..fab8ba4 --- /dev/null +++ b/test/form/indent-true/_expected/amd.js @@ -0,0 +1,9 @@ +define(function () { 'use strict'; + + function foo () { + console.log( 'indented with tabs' ); + } + + return foo; + +}); diff --git a/test/form/indent-true/_expected/cjs.js b/test/form/indent-true/_expected/cjs.js new file mode 100644 index 0000000..7f6e0b9 --- /dev/null +++ b/test/form/indent-true/_expected/cjs.js @@ -0,0 +1,7 @@ +'use strict'; + +function foo () { + console.log( 'indented with tabs' ); +} + +module.exports = foo; diff --git a/test/form/indent-true/_expected/es6.js b/test/form/indent-true/_expected/es6.js new file mode 100644 index 0000000..d4b23ef --- /dev/null +++ b/test/form/indent-true/_expected/es6.js @@ -0,0 +1,5 @@ +function foo () { + console.log( 'indented with tabs' ); +} + +export default foo; diff --git a/test/form/indent-true/_expected/iife.js b/test/form/indent-true/_expected/iife.js new file mode 100644 index 0000000..badad2c --- /dev/null +++ b/test/form/indent-true/_expected/iife.js @@ -0,0 +1,9 @@ +var foo = (function () { 'use strict'; + + function foo () { + console.log( 'indented with tabs' ); + } + + return foo; + +})(); diff --git a/test/form/indent-true/_expected/umd.js b/test/form/indent-true/_expected/umd.js new file mode 100644 index 0000000..e06c50d --- /dev/null +++ b/test/form/indent-true/_expected/umd.js @@ -0,0 +1,13 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.foo = factory(); +}(this, function () { 'use strict'; + + function foo () { + console.log( 'indented with tabs' ); + } + + return foo; + +})); diff --git a/test/form/indent-true/main.js b/test/form/indent-true/main.js new file mode 100644 index 0000000..10005f9 --- /dev/null +++ b/test/form/indent-true/main.js @@ -0,0 +1,3 @@ +export default function foo () { + console.log( 'indented with tabs' ); +} diff --git a/test/function/export-default-named-function/_config.js b/test/function/export-default-named-function/_config.js new file mode 100644 index 0000000..34725d7 --- /dev/null +++ b/test/function/export-default-named-function/_config.js @@ -0,0 +1,8 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'exports a default named function', + exports: function ( exports ) { + assert.equal( exports(), 42 ); + } +}; diff --git a/test/function/export-default-named-function/main.js b/test/function/export-default-named-function/main.js new file mode 100644 index 0000000..f37bd6c --- /dev/null +++ b/test/function/export-default-named-function/main.js @@ -0,0 +1,3 @@ +export default function foo () { + return 42; +};