diff --git a/src/default_config/loaders.js b/src/default_config/loaders.js index a6ae943..36a6c07 100644 --- a/src/default_config/loaders.js +++ b/src/default_config/loaders.js @@ -1,4 +1,4 @@ -const fileExts = ['jpg', 'png', 'gif', 'eot', 'svg', 'ttf', 'woff', 'woff2']; +const fileExts = ['jpg', 'png', 'gif', 'eot', 'svg', 'ttf', 'woff', 'woff2', 'md', 'mdown', 'markdown']; const moduleExts = ['css', 'scss', 'sass']; const loaders = {}; diff --git a/src/default_config/tests/loaders.js b/src/default_config/tests/loaders.js new file mode 100644 index 0000000..7d4e5d2 --- /dev/null +++ b/src/default_config/tests/loaders.js @@ -0,0 +1,42 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; + +import loaders from '../loaders'; + +const returnArg = arg => arg; +const returnNull = () => null; + +const expecteds = { + jpg: returnArg, + png: returnArg, + gif: returnArg, + eot: returnArg, + svg: returnArg, + ttf: returnArg, + woff: returnArg, + woff2: returnArg, + md: returnArg, + mdown: returnArg, + markdown: returnArg, + css: returnNull, + scss: returnNull, + sass: returnNull, +}; + +describe('loaders', () => { + const exts = Object.keys(expecteds); + + expect(loaders).to.have.all.keys(exts); + + exts.forEach((ext) => { + describe(`.${ext}`, () => { + const expected = expecteds[ext]('test'); + + it(`should return "${expected}"`, () => { + const actual = loaders[ext]('test'); + + expect(actual).to.equal(expected); + }); + }); + }); +});