Browse Source

lol git

contingency-plan
Rich-Harris 10 years ago
parent
commit
4095ccaa12
  1. 5
      test/function/allows-external-modules-from-nested-module/_config.js
  2. 15
      test/function/custom-external-resolver-async/_config.js
  3. 1
      test/function/custom-external-resolver-async/js_modules/external.js
  4. 3
      test/function/custom-external-resolver-async/main.js
  5. 14
      test/function/custom-external-resolver-sync/_config.js
  6. 1
      test/function/custom-external-resolver-sync/js_modules/external.js
  7. 3
      test/function/custom-external-resolver-sync/main.js
  8. 5
      test/function/import-default-from-external/_config.js
  9. 5
      test/function/import-named-from-external/_config.js
  10. 5
      test/function/import-namespace-from-external-module-renamed/_config.js
  11. 5
      test/function/import-namespace-from-external-module/_config.js
  12. 5
      test/function/imports-are-deconflicted-b/_config.js
  13. 5
      test/function/imports-are-deconflicted/_config.js
  14. 3
      test/function/legal-import-modification/_config.js
  15. 1
      test/function/legal-import-modification/foo.js
  16. 5
      test/function/legal-import-modification/main.js
  17. 5
      test/function/shadowed-external-export/_config.js
  18. 21
      test/function/transformer-multiple/_config.js
  19. 1
      test/function/transformer-multiple/foo.js
  20. 3
      test/function/transformer-multiple/main.js
  21. 13
      test/function/transformer-single/_config.js
  22. 1
      test/function/transformer-single/foo.js
  23. 3
      test/function/transformer-single/main.js

5
test/function/allows-external-modules-from-nested-module/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'imports external modules from nested internal modules' description: 'imports external modules from nested internal modules',
options: {
external: [ 'path' ]
}
}; };

15
test/function/custom-external-resolver-async/_config.js

@ -0,0 +1,15 @@
var path = require( 'path' );
var assert = require( 'assert' );
var Promise = require( 'sander' ).Promise;
module.exports = {
description: 'uses a custom external path resolver (asynchronous)',
options: {
resolveExternal: function ( id, importer, options ) {
return Promise.resolve( path.resolve( __dirname, 'js_modules', id + '.js' ) );
}
},
exports: function ( exports ) {
assert.ok( exports.success );
}
};

1
test/function/custom-external-resolver-async/js_modules/external.js

@ -0,0 +1 @@
export default { isExternal: true };

3
test/function/custom-external-resolver-async/main.js

@ -0,0 +1,3 @@
import external from 'external';
export default { success: external.isExternal };

14
test/function/custom-external-resolver-sync/_config.js

@ -0,0 +1,14 @@
var path = require( 'path' );
var assert = require( 'assert' );
module.exports = {
description: 'uses a custom external path resolver (synchronous)',
options: {
resolveExternal: function ( id, importer, options ) {
return path.resolve( __dirname, 'js_modules', id + '.js' );
}
},
exports: function ( exports ) {
assert.ok( exports.success );
}
};

1
test/function/custom-external-resolver-sync/js_modules/external.js

@ -0,0 +1 @@
export default { isExternal: true };

3
test/function/custom-external-resolver-sync/main.js

@ -0,0 +1,3 @@
import external from 'external';
export default { success: external.isExternal };

5
test/function/import-default-from-external/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'imports default from external module' description: 'imports default from external module',
options: {
external: [ 'path' ]
}
}; };

5
test/function/import-named-from-external/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'imports names from an external module' description: 'imports names from an external module',
options: {
external: [ 'path' ]
}
}; };

5
test/function/import-namespace-from-external-module-renamed/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'imports a namespace from an external module and renames it' description: 'imports a namespace from an external module and renames it',
options: {
external: [ 'path' ]
}
}; };

5
test/function/import-namespace-from-external-module/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'imports a namespace from an external module' description: 'imports a namespace from an external module',
options: {
external: [ 'path' ]
}
}; };

5
test/function/imports-are-deconflicted-b/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'deconflicts imports (redux)' description: 'deconflicts imports (redux)',
options: {
external: [ 'path' ]
}
}; };

5
test/function/imports-are-deconflicted/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'deconflicts imports' description: 'deconflicts imports',
options: {
external: [ 'path' ]
}
}; };

3
test/function/legal-import-modification/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'assigning to properties of imported bindings is permitted'
};

1
test/function/legal-import-modification/foo.js

@ -0,0 +1 @@
export default {};

5
test/function/legal-import-modification/main.js

@ -0,0 +1,5 @@
import foo from './foo';
foo.modified = true;
export default foo;

5
test/function/shadowed-external-export/_config.js

@ -1,3 +1,6 @@
module.exports = { module.exports = {
description: 'external modules are not shadowed' description: 'external modules are not shadowed',
options: {
external: [ 'path' ]
}
}; };

21
test/function/transformer-multiple/_config.js

@ -0,0 +1,21 @@
var assert = require( 'assert' );
module.exports = {
description: 'accepts multiple transformer functions',
options: {
transform: [
function ( code, path ) {
return code.replace( /MAGIC_NUMBER/g, 3 );
},
function ( code, path ) {
return code.replace( /\d+/g, function ( match ) {
return 2 * +match;
});
}
]
},
exports: function ( exports ) {
assert.equal( exports.magicNumber, 6 );
}
}

1
test/function/transformer-multiple/foo.js

@ -0,0 +1 @@
export default MAGIC_NUMBER;

3
test/function/transformer-multiple/main.js

@ -0,0 +1,3 @@
import foo from './foo';
export var magicNumber = foo;

13
test/function/transformer-single/_config.js

@ -0,0 +1,13 @@
var assert = require( 'assert' );
module.exports = {
description: 'accepts a single transformer function',
options: {
transform: function ( code, path ) {
return code.replace( /MAGIC_NUMBER/g, 3 );
}
},
exports: function ( exports ) {
assert.equal( exports.magicNumber, 3 );
}
}

1
test/function/transformer-single/foo.js

@ -0,0 +1 @@
export default MAGIC_NUMBER;

3
test/function/transformer-single/main.js

@ -0,0 +1,3 @@
import foo from './foo';
export var magicNumber = foo;
Loading…
Cancel
Save