Browse Source

deal with warnings, to make test output clearer

value-tracking
Rich-Harris 8 years ago
parent
commit
525e3de4ed
  1. 5
      test/form/conflicting-imports/_config.js
  2. 3
      test/form/custom-module-context-function/_config.js
  3. 3
      test/form/custom-module-context/_config.js
  4. 1
      test/form/export-default-import/_config.js
  5. 1
      test/form/external-imports-custom-names-function/_config.js
  6. 5
      test/form/external-imports/_config.js
  7. 5
      test/form/import-external-namespace-and-default/_config.js
  8. 1
      test/form/interop-false/_config.js
  9. 1
      test/form/paths-function/_config.js
  10. 1
      test/form/paths/_config.js
  11. 1
      test/form/prefer-const/_config.js
  12. 7
      test/form/side-effect-es5-classes/_config.js
  13. 10
      test/form/unused-import/_config.js

5
test/form/conflicting-imports/_config.js

@ -1,3 +1,6 @@
module.exports = {
description: 'ensures bundle imports are deconflicted (#659)'
description: 'ensures bundle imports are deconflicted (#659)',
options: {
external: [ 'foo', 'bar' ]
}
};

3
test/form/custom-module-context-function/_config.js

@ -3,6 +3,9 @@ module.exports = {
options: {
moduleContext ( id ) {
return /main\.js$/.test( id ) ? 'lolwut' : 'undefined';
},
onwarn ( warning ) {
if ( warning.code !== 'THIS_IS_UNDEFINED' ) throw new Error( 'unexpected warning' );
}
}
};

3
test/form/custom-module-context/_config.js

@ -3,6 +3,9 @@ module.exports = {
options: {
moduleContext: {
'main.js': 'lolwut'
},
onwarn ( warning ) {
if ( warning.code !== 'THIS_IS_UNDEFINED' ) throw new Error( 'unexpected warning' );
}
}
};

1
test/form/export-default-import/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'correctly exports a default import, even in ES mode (#513)',
options: {
external: [ 'x' ],
moduleName: 'myBundle'
}
};

1
test/form/external-imports-custom-names-function/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'allows globals to be specified as a function',
options: {
external: [ 'a-b-c' ],
globals: function ( id ) {
return id.replace( /-/g, '_' );
}

5
test/form/external-imports/_config.js

@ -1,6 +1,9 @@
module.exports = {
description: 'prefixes global names with `global.` when creating UMD bundle (#57)',
options: {
external: [ 'factory', 'baz', 'shipping-port', 'alphabet' ]
external: [ 'factory', 'baz', 'shipping-port', 'alphabet' ],
onwarn: warning => {
if ( warning.code !== 'UNUSED_EXTERNAL_IMPORT' ) throw new Error( 'unexpected warning' );
}
}
};

5
test/form/import-external-namespace-and-default/_config.js

@ -1,3 +1,6 @@
module.exports = {
description: 'disinguishes between external default and namespace (#637)'
description: 'disinguishes between external default and namespace (#637)',
options: {
external: [ 'foo' ]
}
};

1
test/form/interop-false/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'getInterop with interop: false',
options: {
external: [ 'core/view' ],
moduleName: 'foo',
interop: false
}

1
test/form/paths-function/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'external paths (#754)',
options: {
external: [ 'foo' ],
paths: id => `https://unpkg.com/${id}`
}
};

1
test/form/paths/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'external paths (#754)',
options: {
external: [ 'foo' ],
paths: {
foo: 'https://unpkg.com/foo'
}

1
test/form/prefer-const/_config.js

@ -1,6 +1,7 @@
module.exports = {
description: 'uses const instead of var if specified (#653)',
options: {
external: [ 'other' ],
preferConst: true,
moduleName: 'myBundle'
}

7
test/form/side-effect-es5-classes/_config.js

@ -1,3 +1,8 @@
module.exports = {
description: 'omits ES5 classes which are pure (e.g. they only assign to `this`)'
description: 'omits ES5 classes which are pure (e.g. they only assign to `this`)',
options: {
onwarn ( warning ) {
if ( warning.code !== 'THIS_IS_UNDEFINED' ) throw new Error( 'unexpected warning' );
}
}
};

10
test/form/unused-import/_config.js

@ -1,5 +1,9 @@
const assert = require( 'assert' );
module.exports = {
description: 'excludes unused imports ([#595])'
description: 'excludes unused imports ([#595])',
options: {
external: [ 'external' ],
onwarn ( warning ) {
if ( warning.code !== 'UNUSED_EXTERNAL_IMPORT' && warning.code !== 'EMPTY_BUNDLE' ) throw new Error( 'unexpected warning' );
}
}
};

Loading…
Cancel
Save