Skip to content

Commit

Permalink
test: use property matcher to not rely on relative location of… (gats…
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh authored Mar 16, 2020
1 parent a2e8e71 commit c987fc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Object {
"type": "javascript/auto",
"use": Array [
Object {
"loader": "<PROJECT_ROOT>/packages/gatsby/node_modules/babel-loader/lib/index.js",
"loader": StringContaining "babel-loader",
"options": Object {
"babelrc": false,
"cacheIdentifier": "develop---gatsby-dependencies@1.0.0",
Expand All @@ -30,7 +30,7 @@ Object {
"type": "javascript/auto",
"use": Array [
Object {
"loader": "<PROJECT_ROOT>/packages/gatsby/src/utils/babel-loader.js",
"loader": StringContaining "babel-loader",
"options": Object {
"compact": false,
"configFile": true,
Expand Down
16 changes: 14 additions & 2 deletions packages/gatsby/src/utils/__tests__/webpack-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ describe(`webpack utils`, () => {
it(`returns default values without any options`, () => {
const rule = config.rules.js()

expect(rule).toMatchSnapshot()
expect(rule).toMatchSnapshot({
use: [
{
loader: expect.stringContaining(`babel-loader`),
},
],
})
})
describe(`include function`, () => {
let js
Expand Down Expand Up @@ -84,7 +90,13 @@ describe(`webpack utils`, () => {
it(`returns default values without any options`, () => {
const rule = config.rules.dependencies()

expect(rule).toMatchSnapshot()
expect(rule).toMatchSnapshot({
use: [
{
loader: expect.stringContaining(`babel-loader`),
},
],
})
})
describe(`exclude function`, () => {
let dependencies
Expand Down

0 comments on commit c987fc8

Please sign in to comment.