diff --git a/packages/gatsby-plugin-coffeescript/src/__tests__/__snapshots__/gatsby-node.js.snap b/packages/gatsby-plugin-coffeescript/src/__tests__/__snapshots__/gatsby-node.js.snap index d232a3d32d254..a1f68567b3b26 100644 --- a/packages/gatsby-plugin-coffeescript/src/__tests__/__snapshots__/gatsby-node.js.snap +++ b/packages/gatsby-plugin-coffeescript/src/__tests__/__snapshots__/gatsby-node.js.snap @@ -1,29 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`gatsby-plugin-coffeescript contains coffee script extensions 1`] = ` -Array [ - ".coffee", -] -`; - -exports[`gatsby-plugin-coffeescript modifies webpack config with cofeescript extensions 1`] = ` -Array [ - Object { - "module": Object { - "rules": Array [ - Object { - "test": /\\\\\\.coffee\\$/, - "use": Array [ - "babel-loader", - "/resolved/path/coffee-loader", - ], - }, - ], - }, - }, -] -`; - exports[`gatsby-plugin-coffeescript pre processing transforms .coffee files 1`] = ` "(function() { if (typeof elvis !== \\"undefined\\" && elvis !== null) { diff --git a/packages/gatsby-plugin-coffeescript/src/__tests__/gatsby-node.js b/packages/gatsby-plugin-coffeescript/src/__tests__/gatsby-node.js index 339528750d31a..11903cb34ad66 100644 --- a/packages/gatsby-plugin-coffeescript/src/__tests__/gatsby-node.js +++ b/packages/gatsby-plugin-coffeescript/src/__tests__/gatsby-node.js @@ -8,10 +8,10 @@ const { describe(`gatsby-plugin-coffeescript`, () => { it(`contains coffee script extensions`, () => { - expect(resolvableExtensions()).toMatchSnapshot() + expect(resolvableExtensions()).toContain(`.coffee`) }) - it(`modifies webpack config with cofeescript extensions`, () => { + it(`modifies webpack config with coffeescript extensions`, () => { const actions = { setWebpackConfig: jest.fn(), } @@ -23,8 +23,16 @@ describe(`gatsby-plugin-coffeescript`, () => { resolvableExtensions().length ) - const lastCall = actions.setWebpackConfig.mock.calls.pop() - expect(lastCall).toMatchSnapshot() + expect(actions.setWebpackConfig).toHaveBeenLastCalledWith({ + module: { + rules: [ + { + test: /\.coffee$/, + use: [`babel-loader`, `/resolved/path/coffee-loader`], + }, + ], + }, + }) }) describe(`pre processing`, () => {