Skip to content
Merged
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ Add the following to your `jest.config.js` file:
Airtable scripts are always run within the context of a base. To test your scripts locally, you will need to generate an object that stores all the tables, fields, views, and records in your base. You can do this by using the [Test Fixture Generator extension](https://airtable.com/marketplace/blk5qI32GYyYb1Rbm/test-fixture-generator).

> [!IMPORTANT]
> The Test Fixture Generator extension **has a bug** that means you need to edit the output and can't just paste it into a new file.
> The Test Fixture Generator extension assumes you are generating code for testing within an Airtable extension. You will need to change the output before importing it into your test.

To fix the file generated by the Test Fixture Generator extension, you need to remove the `mockSdkWithFixtureData` function and export the fixture data object directly:
To fix the file generated by the Test Fixture Generator extension, you need to remove the `TestDriver` class and export the fixture data object directly:

```js
import { FieldType, ViewType } from '@airtable/blocks/models'
import { mockSdkWithFixtureData } from '@airtable/blocks/testing'
export default mockSdkWithFixtureData({ ...data })
import TestDriver from '@airtable/blocks-testing'
export default new TestDriver({ ...data })
```

Remove all references to `mockSdkWithFixtureData` so that you just export the fixture data object:
Remove all references to `TestDriver` so that you just export the fixture data object:

```js
import { FieldType, ViewType } from '@airtable/blocks/models'
Expand Down