Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.

Commit 15d5241

Browse files
committed
test: moves tests to source folder, updates files field for publish
1 parent d042898 commit 15d5241

File tree

9 files changed

+53
-53
lines changed

9 files changed

+53
-53
lines changed
File renamed without changes.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import "./mocks.js"
2-
import { ReportSteps } from "../bin/helpers/constants.js"
3-
import { getCommitCmd, getTagCmd, getPushCmd } from "../bin/helpers/commands.js"
4-
import { setVersionToString } from "../bin/helpers/transformers.js"
5-
import { reportCmd } from "../bin/helpers/cmd.js"
6-
import { runCommit } from "../bin/modules/commit.js"
7-
8-
jest.mock("../bin/helpers/cmd.js", () => ({
1+
import "../../.jest/mocks.js"
2+
import { ReportSteps } from "../helpers/constants.js"
3+
import { getCommitCmd, getTagCmd, getPushCmd } from "../helpers/commands.js"
4+
import { setVersionToString } from "../helpers/transformers.js"
5+
import { reportCmd } from "../helpers/cmd.js"
6+
import { runCommit } from "../modules/commit.js"
7+
8+
jest.mock("../helpers/cmd.js", () => ({
99
reportCmd: jest.fn(),
1010
}))
1111

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import "./mocks.js"
1+
import "../../.jest/mocks.js"
22
import fs from "fs"
33
import path from "path"
4-
import { report, exitWithError } from "../bin/helpers/reporter.js"
5-
import { cmd } from "../bin/helpers/cmd.js"
6-
import { getVersionCommand } from "../bin/helpers/commands.js"
7-
import { runIncrement } from "../bin/modules/increment.js"
4+
import { report, exitWithError } from "../helpers/reporter.js"
5+
import { cmd } from "../helpers/cmd.js"
6+
import { getVersionCommand } from "../helpers/commands.js"
7+
import { runIncrement } from "../modules/increment.js"
88

9-
jest.mock("../bin/helpers/cmd.js", () => ({
9+
jest.mock("../helpers/cmd.js", () => ({
1010
cmd: jest.fn(),
1111
}))
12-
jest.mock("../bin/helpers/reporter.js", () => ({
12+
jest.mock("../helpers/reporter.js", () => ({
1313
exitWithError: jest.fn(),
1414
report: jest.fn(),
1515
}))
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import "./mocks.js"
2-
import { normalizeConfig } from "../bin/helpers/normalize-config.js"
3-
import { report } from "../bin/helpers/reporter.js"
4-
import { checkUnstaged, checkRefStatus } from "../bin/helpers/git-helpers.js"
5-
import { initialize } from "../bin/modules/initialize"
1+
import "../../.jest/mocks.js"
2+
import { normalizeConfig } from "../helpers/normalize-config.js"
3+
import { report } from "../helpers/reporter.js"
4+
import { checkUnstaged, checkRefStatus } from "../helpers/git-helpers.js"
5+
import { initialize } from "../modules/initialize"
66

7-
jest.mock("../bin/helpers/reporter.js", () => ({
7+
jest.mock("../helpers/reporter.js", () => ({
88
report: jest.fn(),
99
}))
10-
jest.mock("../bin/helpers/normalize-config.js", () => ({
10+
jest.mock("../helpers/normalize-config.js", () => ({
1111
normalizeConfig: jest.fn(),
1212
}))
13-
jest.mock("../bin/helpers/git-helpers.js", () => ({
13+
jest.mock("../helpers/git-helpers.js", () => ({
1414
checkRefStatus: jest.fn(),
1515
checkUnstaged: jest.fn(),
1616
}))
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import "./mocks.js"
1+
import "../../.jest/mocks.js"
22
import path from "path"
3-
import { report } from "../bin/helpers/reporter.js"
4-
import { runNpm } from "../bin/modules/npm.js"
5-
import { runIncrement } from "../bin/modules/increment.js"
6-
import { runPublish } from "../bin/modules/publish.js"
3+
import { report } from "../helpers/reporter.js"
4+
import { runNpm } from "../modules/npm.js"
5+
import { runIncrement } from "../modules/increment.js"
6+
import { runPublish } from "../modules/publish.js"
77

8-
jest.mock("../bin/helpers/reporter.js", () => ({
8+
jest.mock("../helpers/reporter.js", () => ({
99
report: jest.fn(),
1010
}))
11-
jest.mock("../bin/modules/increment.js", () => ({
11+
jest.mock("../modules/increment.js", () => ({
1212
runIncrement: jest.fn(),
1313
}))
14-
jest.mock("../bin/modules/publish.js", () => ({
14+
jest.mock("../modules/publish.js", () => ({
1515
runPublish: jest.fn(),
1616
}))
1717

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import "./mocks.js"
1+
import "../../.jest/mocks.js"
22
import path from "path"
3-
import { getAddCommand, getPublishCommand } from "../bin/helpers/commands.js"
4-
import { cmd } from "../bin/helpers/cmd.js"
5-
import { report } from "../bin/helpers/reporter.js"
6-
import { runPublish } from "../bin/modules/publish.js"
3+
import { getAddCommand, getPublishCommand } from "../helpers/commands.js"
4+
import { cmd } from "../helpers/cmd.js"
5+
import { report } from "../helpers/reporter.js"
6+
import { runPublish } from "../modules/publish.js"
77

8-
jest.mock("../bin/helpers/cmd.js", () => ({
8+
jest.mock("../helpers/cmd.js", () => ({
99
cmd: jest.fn(),
1010
}))
11-
jest.mock("../bin/helpers/reporter.js", () => ({
11+
jest.mock("../helpers/reporter.js", () => ({
1212
report: jest.fn(),
1313
}))
1414

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import "./mocks.js"
2-
import { getArgs } from "../bin/helpers/get-args.js"
3-
import { reportCmd } from "../bin/helpers/cmd.js"
4-
import { setRootVersion } from "../bin/helpers/set-root-version.js"
5-
import { runNpm } from "../bin/modules/npm.js"
6-
import { runCommit } from "../bin/modules/commit.js"
7-
import { release } from "../bin/modules/release.js"
1+
import "../../.jest/mocks.js"
2+
import { getArgs } from "../helpers/get-args.js"
3+
import { reportCmd } from "../helpers/cmd.js"
4+
import { setRootVersion } from "../helpers/set-root-version.js"
5+
import { runNpm } from "../modules/npm.js"
6+
import { runCommit } from "../modules/commit.js"
7+
import { release } from "../modules/release.js"
88

9-
jest.mock("../bin/helpers/get-args.js")
10-
jest.mock("../bin/helpers/cmd.js", () => ({
9+
jest.mock("../helpers/get-args.js")
10+
jest.mock("../helpers/cmd.js", () => ({
1111
reportCmd: jest.fn(),
1212
}))
13-
jest.mock("../bin/helpers/set-root-version.js", () => ({
13+
jest.mock("../helpers/set-root-version.js", () => ({
1414
setRootVersion: jest.fn(),
1515
}))
16-
jest.mock("../bin/modules/commit.js", () => ({
16+
jest.mock("../modules/commit.js", () => ({
1717
runCommit: jest.fn(),
1818
}))
19-
jest.mock("../bin/modules/initialize.js")
20-
jest.mock("../bin/modules/npm.js", () => ({
19+
jest.mock("../modules/initialize.js")
20+
jest.mock("../modules/npm.js", () => ({
2121
runNpm: jest.fn(),
2222
}))
2323

jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"clearMocks": true,
44
"restoreMocks": true,
55
"verbose": true,
6-
"testMatch": ["<rootDir>/__tests__/**/*.spec.js"],
6+
"testMatch": ["<rootDir>/bin/__tests__/**/*.spec.js"],
77
"testURL": "http://localhost/",
88
"transform": {
99
"\\.js$": "babel-jest"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"homepage": "https://github.com/geotrev/release-workspaces#readme",
5757
"files": [
58-
"bin/**/*.js"
58+
"bin/**/!(*.spec).js"
5959
],
6060
"directories": {
6161
"bin": "bin"

0 commit comments

Comments
 (0)