Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(coffee): reword test to fix typo #23477

Merged
merged 2 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
16 changes: 12 additions & 4 deletions packages/gatsby-plugin-coffeescript/src/__tests__/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand All @@ -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`, () => {
Expand Down