diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e2fd9b02..1eb7c1755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,12 +16,12 @@ jobs: strategy: matrix: - node: [14, 16] + node: [14, 16, 18] steps: - uses: actions/checkout@v3 - name: Install pnpm - uses: pnpm/action-setup@v2.2.2 + uses: pnpm/action-setup@v2.2.4 with: version: 7.5.0 - name: Use Node.js ${{ matrix.node }} @@ -32,7 +32,6 @@ jobs: - run: pnpm install - run: pnpm run lint - run: pnpm run test:coverage - - run: pnpm run build env: CI: true - run: pnpm run test:build diff --git a/docs/api/index.md b/docs/api/index.md index a5826c6e2..2cc8c3b3c 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1378,10 +1378,14 @@ test('getComponent', () => { Returns the HTML of an element. +By default the output is formatted with [`js-beautify`](https://github.com/beautify-web/js-beautify) +to make snapshots more readable. Use `raw: true` option to receive the unformatted html string. + **Signature:** ```ts html(): string +html(options?: { raw?: boolean }): string ``` **Details:** @@ -1405,7 +1409,13 @@ import Component from './Component.vue' test('html', () => { const wrapper = mount(Component) - expect(wrapper.html()).toBe('

Hello world

') + expect(wrapper.html()).toBe( + '
\n' + + '

Hello world

\n' + + '
' + ) + + expect(wrapper.html({ raw: true })).toBe('

Hello world

') }) ``` @@ -1633,6 +1643,12 @@ setValue(value: unknown, prop?: string): Promise
The input has been checked!
+ +