Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit bf39192

Browse files
author
george
committed
mock package version and description fields in test to shorten publish time + update npmignore
1 parent f4ce711 commit bf39192

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# - LICENSE
88
# - CONTRIBUTING
99

10-
.DS_store
1110
yarn-error.log*
1211
npm-error.log*
1312

@@ -18,7 +17,6 @@ npm-error.log*
1817
/build/
1918
/coverage/
2019
/dist/*.zip
21-
/node_modules/
2220
/public/
2321
/src/js/__tests__/
2422
/test/

app/components/SideNav/__tests__/SideNav.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { BrowserRouter as Router } from "react-router-dom"
44

55
jest.mock("react-feather/dist/icons/chevron-right", () => global.simpleMock("ChevronRight"))
66
jest.mock("react-feather/dist/icons/menu", () => global.simpleMock("Menu"))
7+
jest.mock("projectRoot/package.json", () => ({
8+
version: "9.9.9",
9+
}))
710

811
const MENU_COLLAPSE_WIDTH = 1199
912
const MENU_EXPAND_WIDTH = MENU_COLLAPSE_WIDTH + 1

app/components/SideNav/__tests__/__snapshots__/SideNav.spec.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ exports[`<SideNav /> #handleMenuToggleClick toggles menu when button is clicked
3535
className="version-text has-no-padding has-gray800-text xsmall-12 columns"
3636
>
3737
Version
38-
5.1.1
38+
9.9.9
3939
</p>
4040
<div
4141
className="accordion-row"
@@ -136,7 +136,7 @@ exports[`<SideNav /> #handleMenuVisibility hides menu at or below 1199 1`] = `
136136
className="version-text has-no-padding has-gray800-text xsmall-12 columns"
137137
>
138138
Version
139-
5.1.1
139+
9.9.9
140140
</p>
141141
<div
142142
className="accordion-row"
@@ -237,7 +237,7 @@ exports[`<SideNav /> #handleMenuVisibility shows menu above 1199 1`] = `
237237
className="version-text has-no-padding has-gray800-text xsmall-12 columns"
238238
>
239239
Version
240-
5.1.1
240+
9.9.9
241241
</p>
242242
<div
243243
className="accordion-row"
@@ -357,7 +357,7 @@ exports[`<SideNav /> #render renders 1`] = `
357357
className="version-text has-no-padding has-gray800-text xsmall-12 columns"
358358
>
359359
Version
360-
5.1.1
360+
9.9.9
361361
</p>
362362
<div
363363
className="accordion-row"

app/pages/Home/__tests__/Home.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jest.mock("../markdownContent", () => ({
1414
InstallAssets: global.simpleMock("Install"),
1515
}))
1616

17+
jest.mock("projectRoot/package.json", () => ({
18+
description: "Mocked description",
19+
version: "9.9.9",
20+
}))
21+
1722
jest.mock("prismjs", () => ({
1823
highlightAll: jest.fn(),
1924
}))

app/pages/Home/__tests__/__snapshots__/Home.spec.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ exports[`<Home /> renders 1`] = `
8585
<PageHeader
8686
className="h3"
8787
>
88-
A modular, configuration-first front-end framework. No strings.
88+
Mocked description
8989
</PageHeader>
9090
</div>
9191
<div
@@ -133,7 +133,7 @@ exports[`<Home /> renders 1`] = `
133133
className="un-version has-no-margin"
134134
>
135135
Version
136-
5.1.1
136+
9.9.9
137137
</p>
138138
</div>
139139
<div

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"update-version": "node bin/update-version.js",
4141
"create-hashes": "node bin/create-hashes.js",
4242
"preversion": "npm run js:build && npm test",
43-
"postversion": "npm run update-version && npm test -- -u && npm run build:dist:release && git add -A && git commit --amend"
43+
"postversion": "npm run update-version && npm run build:dist:release && git add -A && git commit --amend"
4444
},
4545
"devDependencies": {
4646
"@babel/cli": "^7.4.4",

0 commit comments

Comments
 (0)