Skip to content

Commit 89a42da

Browse files
chore: correct package version 3.0.0 (#136)
* latest version is 3.0.0 and the package should match this * updating package reference version to 3.0.0 * converting from using direct import of nock to .nock() helper * moving mocha config to its own file and removing commonjs since this is the default and may cause node 22 conflict
1 parent 7ca62e4 commit 89a42da

File tree

6 files changed

+22
-27
lines changed

6 files changed

+22
-27
lines changed

.mocharc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extension": ["ts"],
3+
"spec": "test/**/*.test.ts",
4+
"require": ["ts-node/register", "source-map-support/register"],
5+
"package": "./package.json",
6+
"reporter": "spec",
7+
"timeout": 360000,
8+
"recursive": true,
9+
"watchExtension": "ts"
10+
}
11+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ EXAMPLES
7575
]
7676
```
7777

78-
_See code: [src/commands/api.ts](https://github.com/heroku/heroku-api-plugin/blob/v2.3.0/src/commands/api.ts)_
78+
_See code: [src/commands/api.ts](https://github.com/heroku/heroku-api-plugin/blob/v3.0.0/src/commands/api.ts)_
7979
<!-- commandsstop -->

package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@heroku-cli/plugin-api",
33
"description": "access the Heroku API directly",
4-
"version": "2.3.0",
4+
"version": "3.0.0",
55
"author": "Heroku",
66
"bugs": {
77
"url": "https://github.com/heroku/heroku-api-plugin/issues"
@@ -48,16 +48,6 @@
4848
"heroku-plugin"
4949
],
5050
"license": "ISC",
51-
"mocha": {
52-
"require": [
53-
"ts-node/register",
54-
"source-map-support/register"
55-
],
56-
"watch-extensions": "ts",
57-
"recursive": true,
58-
"reporter": "spec",
59-
"timeout": 360000
60-
},
6151
"oclif": {
6252
"bin": "heroku",
6353
"commands": "./lib/commands"
@@ -74,7 +64,7 @@
7464
"prepare": "yarn build",
7565
"prepack": "yarn build && oclif manifest",
7666
"pretest": "yarn build && oclif manifest",
77-
"test": "nyc mocha test/**/*.test.ts",
67+
"test": "nyc mocha --config .mocharc.json test/**/*.test.ts",
7868
"version": "oclif readme && git add README.md"
7969
}
8070
}

test/api.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {expect, test} from '@oclif/test'
2-
import * as nock from 'nock'
32

43
describe('api', () => {
54
test
@@ -23,13 +22,12 @@ describe('api', () => {
2322
.it('adds leading slash')
2423

2524
test
26-
.add('api', () => nock('https://api.heroku.com', {
25+
.nock('https://api.heroku.com', {
2726
reqheaders: {accept: 'application/vnd.heroku+json; version=3.foobar'},
28-
}))
29-
.do(({api}) => {
30-
api.get('/hello')
31-
.reply(200, 'hello!')
32-
})
27+
}, api => api
28+
.get('/hello')
29+
.reply(200, 'hello!'),
30+
)
3331
.stdout()
3432
.command(['api', '/hello', '--version=3.foobar'])
3533
.do(({stdout}) => expect(stdout).to.equal('hello!\n'))

test/mocha.opts

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "../tsconfig",
33
"compilerOptions": {
4-
"sourceMap": true
4+
"sourceMap": true,
5+
"esModuleInterop": true,
6+
"allowSyntheticDefaultImports": true
57
},
68
"include": [
79
"./**/*",

0 commit comments

Comments
 (0)