Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upgrade deps and improve jsdom support #21

Merged
merged 3 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
pull_request:
types: [opened, synchronize]
push:
branches: [main]

concurrency:
group: "${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Use node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci
- name: Format Code
run: npm run format
- name: Lint Code
run: npm run lint
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci] format"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ubuntu-latest
name: "test: node@${{ matrix.node }}"
strategy:
fail-fast: false
matrix:
node: [14, 16, 18]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use node@${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run ci:test
- name: Report code coverage
uses: codecov/codecov-action@v2
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" alt="Styled with prettier"/>
</a>
<!-- CI -->
<a href="https://travis-ci.org/eBay/visual-html">
<img src="https://img.shields.io/travis/eBay/visual-html.svg" alt="Build status"/>
<a href="https://github.com/ebay/visual-html/actions/workflows/ci.yml">
<img src="https://github.com/ebay/visual-html/actions/workflows/ci.yml/badge.svg" alt="Build status"/>
</a>
<!-- Coverage -->
<a href="https://coveralls.io/github/eBay/visual-html">
<img src="https://img.shields.io/coveralls/eBay/visual-html.svg" alt="Test Coverage"/>
<a href="https://codecov.io/gh/eBay/visual-html" >
<img src="https://codecov.io/gh/eBay/visual-html/branch/main/graph/badge.svg?token=g3LEY5qJGW" alt="Code Coverage"/>
</a>
<!-- NPM Version -->
<a href="https://npmjs.org/package/visual-html">
Expand Down Expand Up @@ -120,31 +120,29 @@ visualHTML(div); // Returns the html below as string.
```

```html
<div style="
<div
style="
background: red;
height: 200px;
transform: translateX(-100px);
width: 100px
">
<span style="color: #333">
Hello!
</span>
"
>
<span style="color: #333"> Hello! </span>
<form>
<label>
Username:
<input />
</label>
<label>
Password:
<input type="password"/>
<input type="password" />
</label>
<label>
Remember Me:
<input type="checkbox" />
</label>
<button>
Sign in
</button>
<button>Sign in</button>
</form>
</div>
```
Expand Down Expand Up @@ -221,7 +219,8 @@ as the element is still ultimately displayed the same, your test will continue t
This project adheres to the [eBay Code of Conduct](http://ebay.github.io/codeofconduct). By participating in this project you agree to abide by its terms.

## License
Copyright 2019 eBay Inc.

Copyright 2019 eBay Inc.
Author/Developer: Dylan Piercey, Michael Rawlings

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
preset: "ts-jest"
preset: "ts-jest",
testEnvironment: "jsdom",
};
Loading