Skip to content

Commit 39b04bd

Browse files
authored
Merge pull request #11 from usdigitalresponse/kevee/fix-module-include-fs
Documentation updates
2 parents e1a8584 + b9bbfc7 commit 39b04bd

File tree

13 files changed

+208
-42
lines changed

13 files changed

+208
-42
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ jobs:
1717
node-version: ${{ matrix.node-version }}
1818
- run: npm i
1919
- run: npm run ci
20+
- name: Test Report
21+
uses: dorny/test-reporter@v1
22+
if: success() || failure()
23+
with:
24+
name: JEST Tests
25+
path: reports/jest-*.xml
26+
reporter: jest-junit
2027
build:
2128
runs-on: ubuntu-latest
2229

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ dist
130130
.pnp.*
131131

132132
dist
133-
src/environment/sdk.js
133+
src/environment/sdk.js
134+
reports

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.0.4] - 2025-01-13
11+
12+
### Changed
13+
14+
- Fixed FS module not being available in the SDK.
15+
- Clarified some types in the input SDK.
16+
- General cleanup of some comments.
17+
1018
## [0.0.3] - 2025-01-10
1119

1220
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**Please review USDR’s general guidelines for software & data, too: https://policies.usdigitalresponse.org/data-and-software-guidelines**
22

3-
[![Code of Conduct](https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg?style=flat)](./CODE_OF_CONDUCT.md)
3+
[![Code of Conduct](https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg?style=flat)](./CODE_OF_CONDUCT.md) ![Test and lint](https://github.com/usdigitalresponse/jest-environment-airtable-script/actions/workflows/ci.yml/badge.svg)
44

55
# Jest Airtable Script
66

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import tseslint from 'typescript-eslint'
66
export default [
77
...tseslint.config(eslint.configs.recommended, tseslint.configs.recommended),
88
{
9-
ignores: ['**/__sdk.js', '**/*.test.ts'],
9+
ignores: ['**/sdk.js', '**/*.test.ts'],
1010
},
1111
{
1212
rules: {

package-lock.json

Lines changed: 45 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-environment-airtable-script",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "A jest environment for testing Airtable scripts in extensions and automations",
55
"license": "Apache-2.0",
66
"author": "",
@@ -33,8 +33,9 @@
3333
"build:sdk": "rollup -c rollup-sdk.config.mjs",
3434
"build:package": "rollup -c rollup.config.mjs",
3535
"jest": "JEST_AIRTABLE_TS_DEV=true jest",
36+
"jest:ci": "JEST_AIRTABLE_TS_DEV=true jest --reporters=default --reporters=jest-junit",
3637
"test": "run-s build:sdk jest",
37-
"ci": "run-s lint test",
38+
"ci": "run-s lint build:sdk jest:ci",
3839
"watch": "npm-watch test",
3940
"lint": "eslint ./src",
4041
"prepare": "husky"
@@ -60,6 +61,7 @@
6061
"eslint": "^9.17.0",
6162
"husky": "^9.1.7",
6263
"jest": "^29.7.0",
64+
"jest-junit": "^16.0.0",
6365
"npm-run-all": "^4.1.5",
6466
"npm-watch": "^0.13.0",
6567
"rollup": "^4.29.1",
@@ -69,8 +71,15 @@
6971
"typescript-eslint": "^8.19.0"
7072
},
7173
"dependencies": {
72-
"camelize-ts": "^3.0.0",
73-
"detect-ts-node": "^1.0.5",
7474
"luxon": "^3.5.0"
75+
},
76+
"jest-junit": {
77+
"outputDirectory": "reports",
78+
"outputName": "jest-junit.xml",
79+
"ancestorSeparator": "",
80+
"uniqueOutputName": "false",
81+
"suiteNameTemplate": "{filepath}",
82+
"classNameTemplate": "{classname}",
83+
"titleTemplate": "{title}"
7584
}
7685
}

src/environment/mutation-types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Taken from:
44
* @see https://github.com/Airtable/blocks/blob/6c0a2ed709a34e28cb3e999fc6cc6406eaa3817b/packages/sdk/src/types/mutations.ts
55
*/
6-
76
const MutationTypes = Object.freeze({
87
SET_MULTIPLE_RECORD_CELL_VALUES: 'setMultipleRecordCellValues' as const,
98
DELETE_RECORD: 'deleteRecord' as const,

src/environment/sdk/globals/base/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { pascalCase } from '../../lib/pascal-case'
66
import { MutationTypes } from '../../../mutation-types'
77
import { FixtureTable } from '../globals'
88

9-
interface Base {
9+
type Base = {
1010
id: string | null
1111
name: string | null
1212
activeCollaborators: Array<Collaborator> | null

src/environment/sdk/globals/globals.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import type { Mutation } from './mutations'
55
import type { FieldType } from './base/field'
66
import type { ViewType } from './base/view'
77

8+
/**
9+
* The "fixture" types are loose types used to defined base objects
10+
* exported from the Test Fixture Generator extension. Since these
11+
* are pretty inconsisstent, there are anumber of optional keys.
12+
*/
813
type FixtureField = {
914
id: string
1015
name: string
@@ -45,6 +50,9 @@ type FixtureBase = {
4550
collaborators: Collaborator[]
4651
}
4752

53+
/**
54+
* Declare all the global variables that are available in the scripting environment.
55+
*/
4856
declare global {
4957
var __currentUser: Collaborator | undefined
5058
var __inAutomation: boolean

0 commit comments

Comments
 (0)