Skip to content

Commit a240e66

Browse files
authored
1.x (#17)
* make dependencies explicit * fix: update dependency versions * Release v1.0.0 * fix: ban-ts-ignore was replaced by ban-ts-comment * fix: import as a type * Release v1.0.1 * Release v1.0.2 * Release v1.0.3-beta * fix: modify plugin dependencies according to toolbelt 3.x * chore: bump toolbelt to new test version * Release v1.0.4-beta * update CHANGELOG * Release v1.0.4 * Automatic update on Toolbelt plugin documentation
1 parent f85c723 commit a240e66

File tree

9 files changed

+2590
-1435
lines changed

9 files changed

+2590
-1435
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"jest": true
88
},
99
"rules": {
10-
"@typescript-eslint/ban-ts-ignore": "warn",
10+
"@typescript-eslint/ban-ts-comment": "warn",
1111
"@typescript-eslint/explicit-member-accessibility": "off",
1212
"@typescript-eslint/interface-name-prefix": "off",
1313
"@typescript-eslint/no-explicit-any": "off",

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [1.0.4] - 2021-10-07
10+
11+
### Changed
12+
- Update CommandError to createFlowIssueError to conform to toolbelt 3.x.
13+
- Update runYarnIfPathExists import path.
14+
15+
### Fixed
16+
- Make dependencies explicit.
17+
- [lint] Use ban-ts-comment instead of ban-ts-ignore.
18+
- [lint] Remove disable for @typescript-eslint/camelcase.
19+
820
### Changed
921
- [ci] Automatic plugin documentation
1022

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $ npm install -g @vtex/cli-plugin-test
1818
$ oclif-example COMMAND
1919
running command...
2020
$ oclif-example (-v|--version|version)
21-
@vtex/cli-plugin-test/0.0.5 linux-x64 node-v12.18.3
21+
@vtex/cli-plugin-test/1.0.4 linux-x64 node-v12.22.6
2222
$ oclif-example --help [COMMAND]
2323
USAGE
2424
$ oclif-example COMMAND
@@ -36,39 +36,39 @@ Run your VTEX app's integration tests
3636

3737
```
3838
USAGE
39-
$ oclif-example test:e2e
39+
$ oclif-example test e2e
4040
4141
OPTIONS
42-
-h, --help show CLI help
42+
-h, --help Shows this help message.
4343
-r, --report=report Check the results and state of a previously started test given its ID
4444
4545
-t, --token [Not recommended] Send your personal authorization token to your test session so it's available
4646
while running the tests. It can be dangerous because exposes the token via 'authToken'
4747
environment variable
4848
49-
-v, --verbose Show debug level logs
49+
-v, --verbose Shows debug level logs.
5050
5151
-w, --workspace Test workspace's apps
5252
53-
--trace Ensure all requests to VTEX IO are traced
53+
--trace Ensures all requests to VTEX IO are traced.
5454
```
5555

56-
_See code: [build/commands/test/e2e.ts](https://github.com/vtex/cli-plugin-test/blob/v0.0.5/build/commands/test/e2e.ts)_
56+
_See code: [build/commands/test/e2e.ts](https://github.com/vtex/cli-plugin-test/blob/v1.0.4/build/commands/test/e2e.ts)_
5757

5858
## `oclif-example test:unit`
5959

6060
Run your VTEX app unit tests
6161

6262
```
6363
USAGE
64-
$ oclif-example test:unit
64+
$ oclif-example test unit
6565
6666
OPTIONS
67-
-h, --help show CLI help
67+
-h, --help Shows this help message.
6868
-u, --unsafe Allow tests with Typescript errors
69-
-v, --verbose Show debug level logs
70-
--trace Ensure all requests to VTEX IO are traced
69+
-v, --verbose Shows debug level logs.
70+
--trace Ensures all requests to VTEX IO are traced.
7171
```
7272

73-
_See code: [build/commands/test/unit.ts](https://github.com/vtex/cli-plugin-test/blob/v0.0.5/build/commands/test/unit.ts)_
73+
_See code: [build/commands/test/unit.ts](https://github.com/vtex/cli-plugin-test/blob/v1.0.4/build/commands/test/unit.ts)_
7474
<!-- commandsstop -->

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
{
22
"name": "@vtex/cli-plugin-test",
33
"description": "vtex plugin test",
4-
"version": "0.0.5",
4+
"version": "1.0.4",
55
"bugs": "https://github.com/vtex/cli-plugin-test/issues",
66
"dependencies": {
77
"@oclif/command": "^1",
88
"@oclif/config": "^1",
99
"@tiagonapoli/oclif-plugin-spaced-commands": "^0.0.6",
10+
"@vtex/api": "3.77.0",
1011
"async-retry": "^1.3.1",
1112
"chalk": "^4.1.0",
13+
"ramda": "0.25.0",
1214
"tslib": "^1"
1315
},
1416
"devDependencies": {
1517
"@oclif/dev-cli": "^1",
1618
"@oclif/plugin-help": "^3",
1719
"@types/jest": "^26.0.3",
1820
"@types/node": "^14.0.14",
21+
"@types/ramda": "0.25.24",
1922
"eslint": "^6.8.0",
2023
"eslint-config-oclif": "^3.1",
2124
"eslint-config-oclif-typescript": "^0.1",
@@ -27,8 +30,8 @@
2730
"prettier": "^2.0.1",
2831
"ts-jest": "^25.2.1",
2932
"ts-node": "^8.10.2",
30-
"typescript": "^3.8.2",
31-
"vtex": "2.105.1-beta.8"
33+
"typescript": "^3.9.7",
34+
"vtex": "3.8.0-beta.1"
3235
},
3336
"engines": {
3437
"node": ">=8.0.0"

src/clients/Tester.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { AppClient, CacheType, InstanceOptions, IOContext } from '@vtex/api'
1+
import type { InstanceOptions, IOContext } from '@vtex/api'
2+
import { AppClient, CacheType } from '@vtex/api'
23
import { IOClientFactory } from 'vtex'
34

45
export interface SpecTestReport {

src/modules/apps/e2e/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import {
1010
publicEndpoint,
1111
} from 'vtex'
1212

13-
import { parseReport, AppTest, passedApp } from './specsState'
13+
import type { AppTest } from './specsState'
14+
import { parseReport, passedApp } from './specsState'
1415

15-
import { Tester, AppReport, TestRequest } from '../../../clients/Tester'
16+
import type { AppReport, TestRequest } from '../../../clients/Tester'
17+
import { Tester } from '../../../clients/Tester'
1618

1719
const POLL_INTERVAL = 2000
1820

src/modules/apps/e2e/specsState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SpecReport, AppReport, TestReport } from '../../../clients/Tester'
1+
import type { SpecReport, AppReport, TestReport } from '../../../clients/Tester'
22

33
const COMPLETED_STATES = ['passed', 'failed', 'skipped', 'error']
44

src/modules/apps/testCommand.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
import retry from 'async-retry'
22
import chalk from 'chalk'
33
import { concat, map, prop } from 'ramda'
4+
import type { PinnedDeps, BatchStream } from 'vtex'
45
import {
5-
CommandError,
66
Builder,
7+
createFlowIssueError,
78
createPathToFileObject,
89
YarnFilesManager,
910
fixPinnedDependencies,
10-
PinnedDeps,
1111
toAppLocator,
1212
logger,
1313
ManifestEditor,
1414
getAppRoot,
1515
listenBuild,
16-
BatchStream,
17-
runYarnIfPathExists,
1816
listLocalFiles,
1917
ProjectUploader,
2018
validateAppAction,
2119
} from 'vtex'
20+
import { runYarnIfPathExists } from 'vtex/lib/modules/utils'
2221

2322
const root = getAppRoot()
2423
const buildersToRunLocalYarn = ['react', 'node']
@@ -116,7 +115,7 @@ export default async (options) => {
116115
map(runYarnIfPathExists, buildersToRunLocalYarn)
117116

118117
const onError = {
119-
// eslint-disable-next-line @typescript-eslint/camelcase
118+
// eslint-disable-next-line
120119
build_failed: () => {
121120
logger.error(`App build failed. Waiting for changes...`)
122121
},
@@ -147,7 +146,7 @@ export default async (options) => {
147146
}
148147

149148
if (data.code === 'link_on_production') {
150-
throw new CommandError(
149+
throw createFlowIssueError(
151150
`Please use a dev workspace to test apps. Create one with (${chalk.blue(
152151
'vtex use <workspace> -rp'
153152
)}) to be able to test apps`

0 commit comments

Comments
 (0)