Skip to content

Commit

Permalink
feat!: version 3 (#387)
Browse files Browse the repository at this point in the history
* feat!: version 3

BREAKING CHANGE: node 18+, fancy-test v3

* chore: update github workflows

* chore(release): 2.5.7-beta.0 [skip ci]

* chore: major version bump

* chore(release): 3.0.0-beta.1 [skip ci]

* chore: pass token to automerge

* chore: bump chai to resolve dependabot vuln

---------

Co-authored-by: svc-cli-bot <[email protected]>
Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
3 people committed Sep 28, 2023
1 parent 8e23231 commit dd9a700
Show file tree
Hide file tree
Showing 13 changed files with 1,232 additions and 880 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: automerge
on:
workflow_dispatch:
schedule:
- cron: '17 2,5,8,11 * * *'
- cron: "17 2,5,8,11 * * *"

jobs:
automerge:
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets: inherit
secrets:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
36 changes: 0 additions & 36 deletions .github/workflows/manualRelease.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/onPushToMain.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
test helpers for oclif components

[![Version](https://img.shields.io/npm/v/@oclif/test.svg)](https://npmjs.org/package/@oclif/test)
[![CircleCI](https://circleci.com/gh/oclif/test/tree/main.svg?style=svg)](https://circleci.com/gh/oclif/test/tree/main)
[![Known Vulnerabilities](https://snyk.io/test/npm/@oclif/test/badge.svg)](https://snyk.io/test/npm/@oclif/test)
[![Downloads/week](https://img.shields.io/npm/dw/@oclif/test.svg)](https://npmjs.org/package/@oclif/test)
[![License](https://img.shields.io/npm/l/@oclif/test.svg)](https://github.com/oclif/test/blob/main/package.json)
10 changes: 0 additions & 10 deletions greenkeeper.json

This file was deleted.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{
"name": "@oclif/test",
"description": "test helpers for oclif components",
"version": "2.5.6",
"version": "3.0.0-beta.1",
"author": "Salesforce",
"bugs": "https://github.com/oclif/test/issues",
"dependencies": {
"@oclif/core": "^2.15.0",
"fancy-test": "^2.0.42"
"@oclif/core": "^3.0.0-beta.17",
"fancy-test": "^3.0.1"
},
"devDependencies": {
"@types/chai": "^4.3.6",
"@types/mocha": "^9.1.1",
"@types/node": "^14.18.63",
"chai": "^4.3.8",
"eslint": "^7.32.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^1.0.3",
"@types/mocha": "^10",
"@types/node": "^18",
"chai": "^4.3.10",
"eslint": "^8.49.0",
"eslint-config-oclif": "^5.0.0",
"eslint-config-oclif-typescript": "^2.0.1",
"globby": "^11.0.1",
"mocha": "^9",
"mocha": "^10",
"nock": "^13.3.3",
"shx": "^0.3.3",
"ts-node": "^9.0.0",
"typescript": "4.6.4"
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"typescript": "^5"
},
"engines": {
"node": ">=12.0.0"
"node": ">=18.0.0"
},
"files": [
"/lib"
Expand All @@ -38,11 +39,11 @@
"repository": "oclif/test",
"scripts": {
"build": "shx rm -rf lib && tsc",
"lint": "eslint . --ext .ts --config .eslintrc",
"lint": "eslint . --ext .ts",
"posttest": "yarn lint",
"prepublishOnly": "yarn run build",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"pretest": "yarn build --noEmit && tsc -p test --noEmit"
},
"types": "lib/index.d.ts"
}
}
17 changes: 7 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path'
import {dirname} from 'node:path'

import {Config} from '@oclif/core'
import {expect, fancy, FancyTypes} from 'fancy-test'
import {fancy} from 'fancy-test'

import {command} from './command'
import exit from './exit'
Expand All @@ -11,7 +10,7 @@ import {loadConfig} from './load-config'
function traverseFilePathUntil(filename: string, predicate: (filename: string) => boolean): string {
let current = filename
while (!predicate(current)) {
current = path.dirname(current)
current = dirname(current)
}

return current
Expand All @@ -30,9 +29,7 @@ export const test = fancy

export default test

export {
expect,
FancyTypes,
Config,
command,
}
export {Config} from '@oclif/core'
export {expect, FancyTypes} from 'fancy-test'

export {command} from './command'
4 changes: 2 additions & 2 deletions test/command.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as path from 'path'
import {join} from 'node:path'

import {expect, test} from '../src'

// eslint-disable-next-line unicorn/prefer-module
const root = path.join(__dirname, 'fixtures/multi')
const root = join(__dirname, 'fixtures/multi')

describe('command', () => {
test
Expand Down
5 changes: 3 additions & 2 deletions test/exit.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as path from 'path'
import {join} from 'node:path'

import {expect, test} from '../src'

const root = path.join(__dirname, 'fixtures/multi')
// eslint-disable-next-line unicorn/prefer-module
const root = join(__dirname, 'fixtures/multi')

describe('exit', () => {
test
Expand Down
5 changes: 3 additions & 2 deletions test/hook.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as path from 'path'
import {join} from 'node:path'

import {expect, test} from '../src'

const root = path.join(__dirname, 'fixtures/multi')
// eslint-disable-next-line unicorn/prefer-module
const root = join(__dirname, 'fixtures/multi')

describe('hooks', () => {
test
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MockOs {
for (const os of ['darwin', 'win32', 'linux']) {
describe(os, () => {
test
.stub(MockOs, 'platform', () => os)
.stub(MockOs, 'platform', stub => stub.returns(os))
.end('sets os', () => {
expect(MockOs.platform()).to.equal(os)
})
Expand Down
Loading

0 comments on commit dd9a700

Please sign in to comment.