Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Merge pull request #56 from ericclemmons/49-ignore-markdown
Browse files Browse the repository at this point in the history
Default loaders.js ignores .md, .mdown .markdown
  • Loading branch information
roonyh authored Nov 8, 2016
2 parents 8aad91a + 41fdad4 commit 6823e05
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/default_config/loaders.js
Original file line number Diff line number Diff line change
@@ -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 = {};
Expand Down
42 changes: 42 additions & 0 deletions src/default_config/tests/loaders.js
Original file line number Diff line number Diff line change
@@ -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);
});
});
});
});

0 comments on commit 6823e05

Please sign in to comment.