Skip to content

Commit 38b607e

Browse files
committed
Tidy README & don't rely on unsupported API in tests
1 parent 26cd837 commit 38b607e

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,8 @@ The library can be configured via the `configure` function, which accepts:
952952

953953
Configuration options:
954954

955-
`testIdAttribute`
956-
: The attribute used by `getByTestId` and related queries. Defaults to `data-testid`. See [`getByTestId`](#getbytestid).
955+
`testIdAttribute`: The attribute used by `getByTestId` and related queries.
956+
Defaults to `data-testid`. See [`getByTestId`](#getbytestid).
957957

958958
## Implementations
959959

src/__tests__/config.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ describe('configuration API', () => {
2828

2929
describe('configure', () => {
3030
test('merges a delta rather than replacing the whole config', () => {
31-
configure({newKey: 123})
3231
const conf = getConfig()
33-
expect(conf).toMatchObject({
34-
newKey: 123,
35-
testIdAttribute: 'data-testid',
36-
})
32+
expect(conf).toMatchObject({testIdAttribute: 'data-testid'})
3733
})
3834

3935
test('overrides existing values', () => {
@@ -45,15 +41,14 @@ describe('configuration API', () => {
4541
test('passes existing config out to config function', () => {
4642
// Create a new config key based on the value of an existing one
4743
configure(existingConfig => ({
48-
newKey: `${existingConfig.testIdAttribute}-derived`,
44+
testIdAttribute: `${existingConfig.testIdAttribute}-derived`,
4945
}))
5046
const conf = getConfig()
5147

5248
// The new value should be there, and existing values should be
5349
// untouched
5450
expect(conf).toMatchObject({
55-
testIdAttribute: 'data-testid',
56-
newKey: 'data-testid-derived',
51+
testIdAttribute: 'data-testid-derived',
5752
})
5853
})
5954
})

0 commit comments

Comments
 (0)