Skip to content

Commit 57357c6

Browse files
committed
feat: add attrs to render function
1 parent 342e265 commit 57357c6

7 files changed

Lines changed: 283 additions & 505 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.2.0] - 2023-07-17
8+
9+
### Updates
10+
- Add `attrs` argument to `render` function
11+
712
## [2.1.2] - 2022-11-29
813

914
### Updates

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ import { init, render } from '@ficusjs/testing'
5454
test.before(init)
5555

5656
test('render basic component', async t => {
57-
const comp = await render('basic-comp', () => import('../src/component.mjs'))
58-
t.is(comp.querySelector('p').textContent, 'Basic component')
57+
const comp = await render('basic-comp', () => import('../src/component.mjs'), { foo: 'bar' })
58+
t.is(comp.querySelector('p').textContent, 'Basic component with bar')
5959
})
6060
```
6161

@@ -65,6 +65,7 @@ The `render` function accepts the following arguments:
6565
|------------|------------|------------------------------------------------------------------------|
6666
| `tagName` | `string` | The web component tag name |
6767
| `importer` | `function` | A function that registers a web component. This can return a `Promise` |
68+
| `attrs` | `object` | An optional object of attributes to set on the component instance |
6869

6970
## Testing components
7071

0 commit comments

Comments
 (0)