Skip to content

Instantly share code, notes, and snippets.

@diessica
Created May 31, 2016 16:50
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diessica/76cdb131ddba6ef103d688ab7165c74e to your computer and use it in GitHub Desktop.
Save diessica/76cdb131ddba6ef103d688ab7165c74e to your computer and use it in GitHub Desktop.
Mocha compiler to ignore extensions
/*eslint-disable*/
'use strict'
var babel = require('babel-core/register');
function noop() {
return null;
}
require.extensions['.scss'] = noop;
require.extensions['.css'] = noop;
require.extensions['.svg'] = noop;
require.extensions['.png'] = noop;
@rxaviers
Copy link

Why do you define babel if you don't use it?

Do you get this complain? Should '.svg' tranform return something else than null instead?

Warning: Failed propType: Invalid prop `src` of type `object` supplied to `InlineSVG`, expected `string`.

@rxaviers
Copy link

By the way, to fix the above warning:

require.extensions['.svg'] =
require.extensions['.png'] = function exportEmptyString (module) {
  module.exports = '';
};

@AlexZahar
Copy link

@rxaviers up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment