Skip to content

Commit

Permalink
chore: remove windows from CI coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Dec 2, 2021
1 parent bf17498 commit 1acf9d9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
node: [12, 14, 16]
runs-on: ${{ matrix.os }}
steps:
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ Usage example:

```javascript
const {resolve} = require('path')
const {render, fireEvent} = require('cli-testing-library')
const {render} = require('cli-testing-library')

test('Is able to make terminal input and view in-progress stdout', async () => {
const {cleanup, findByText} = await render('node', [
const {cleanup, findByText, userEvent} = await render('node', [
resolve(__dirname, './execute-scripts/stdio-inquirer.js'),
])

Expand All @@ -81,17 +81,23 @@ test('Is able to make terminal input and view in-progress stdout', async () => {

cleanup()

fireEvent.down(instance)
userEvent("[ArrowDown]")

expect(await findByText('❯ Two')).toBeTruthy()

cleanup()

fireEvent.enter(instance)
userEvent.keyboard("[Enter]")

expect(await findByText('First option: Two')).toBeTruthy()
})
```

> While this library _does_ work in Windows, it does not appear to function properly in Windows CI environments, such
> as GitHub actions. As a result, you may need to either switch CI systems or limit your CI to only run in Linux
>
> If you know how to fix this, please let us know in [this tracking issue](https://github.com/crutchcorn/cli-testing-library/issues/3)
## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand All @@ -110,4 +116,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@types/lz-string": "^1.3.34",
"@types/strip-final-newline": "^3.0.0",
"inquirer": "^8.2.0",
"is-ci": "^3.0.1",
"jest-in-case": "^1.0.2",
"jest-snapshot-serializer-ansi": "^1.0.0",
"jest-watch-select-projects": "^2.0.0",
Expand Down
11 changes: 0 additions & 11 deletions src/__tests__/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@ const {render, cleanup} = require('../pure')
const {fireEvent} = require('../events')
const {waitFor} = require('../wait-for')
const {default: userEvent} = require('../user-event')
const {getConfig, configure} = require("../config");

afterEach(async () => {
await cleanup()
})

let originalConfig
beforeAll(() => {
originalConfig = getConfig()
configure({asyncUtilTimeout: 7000, errorDebounceTimeout: 500})
})

afterAll(() => {
configure(originalConfig)
})

test('fireEvent write works', async () => {
const props = await render('node', [
resolve(__dirname, './execute-scripts/stdio-inquirer.js'),
Expand Down
4 changes: 1 addition & 3 deletions tests/setup-env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import jestSnapshotSerializerAnsi from 'jest-snapshot-serializer-ansi'
import isCI from "is-ci";

expect.addSnapshotSerializer(jestSnapshotSerializerAnsi)
// add serializer for MutationRecord
Expand Down Expand Up @@ -46,6 +45,5 @@ afterAll(() => {
jest.restoreAllMocks()
})

const isWindowsCI = isCI && process.platform === "win32";

jest.setTimeout(isWindowsCI ? 15000 : 7000)
jest.setTimeout(7000)

0 comments on commit 1acf9d9

Please sign in to comment.