Skip to content

chore: add build step to CI #32

chore: add build step to CI

chore: add build step to CI #32

GitHub Actions / JEST Tests succeeded Jan 13, 2025 in 0s

205 passed, 0 failed and 1 skipped

Tests passed successfully

✅ reports/jest-junit.xml

206 tests were completed in 2s with 205 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
examples/input/index.test.ts 1✅ 121ms
examples/simple/index.test.ts 1✅ 94ms
src/environment/console-aggregator.test.ts 4✅ 59ms
src/environment/sdk/globals/base/field.test.ts 9✅ 66ms
src/environment/sdk/globals/base/index.test.ts 11✅ 98ms
src/environment/sdk/globals/base/record-query-result.test.ts 6✅ 103ms
src/environment/sdk/globals/base/record/record.test.ts 6✅ 53ms
src/environment/sdk/globals/base/record/render-cell-as-string.test.ts 36✅ 418ms
src/environment/sdk/globals/base/table.test.ts 37✅ 428ms
src/environment/sdk/globals/base/view.test.ts 5✅ 95ms
src/environment/sdk/globals/cursor.test.ts 8✅ 52ms
src/environment/sdk/globals/input.test.ts 29✅ 500ms
src/environment/sdk/globals/output.test.ts 6✅ 58ms
src/environment/sdk/globals/session.test.ts 2✅ 90ms
src/environment/sdk/lib/pascal-case.test.ts 7✅ 71ms
src/environment/sdk/lib/uuid.test.ts 4✅ 47ms
test/cell-format.test.ts 2✅ 90ms
test/console.test.ts 3✅ 164ms
test/fetch.test.ts 2✅ 1⚪ 78ms
test/index.test.ts 3✅ 113ms
test/input.test.ts 9✅ 316ms
test/mutation-types.test.ts 1✅ 42ms
test/mutations.test.ts 9✅ 372ms
test/output.test.ts 2✅ 128ms
test/session.test.ts 2✅ 274ms

✅ examples/input/index.test.ts

Airtable Script Environment input example
  ✅ should select a table and a record

✅ examples/simple/index.test.ts

Airtable Script Environment: Examples: Simple
  ✅ should return a list of record ratings

✅ src/environment/console-aggregator.test.ts

consoleAggregator
  ✅ should log messages
  ✅ should warn messages
  ✅ should error messages
  ✅ should aggregate multiple messages

✅ src/environment/sdk/globals/base/field.test.ts

Field
  ✅ should create a Field instance with correct properties
  ✅ should set description to null if not provided
  ✅ should set options to null if not provided
  ✅ should return true for isComputed if field type is computed
  ✅ should return false for isComputed if field type is not computed
  ✅ should update the description asynchronously
  ✅ should set description to empty string if null is passed
  ✅ should update the options asynchronously
  ✅ should update the name asynchronously

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

Base SDK test › Properties
  ✅ get the base ID
  ✅ get the base Name
  ✅ gets the active collaborators
  ✅ gets all tables
Base SDK test › Collaborators
  ✅ finds a collaborator by ID
  ✅ finds a collaborator by name
  ✅ finds a collaborator by email
Base SDK test › getTable
  ✅ finds a table by ID
  ✅ finds a table by name
Base SDK test › createTable
  ✅ creates a table
  ✅ throws an error if a field has an invalid type

✅ src/environment/sdk/globals/base/record-query-result.test.ts

RecordQueryResult
  ✅ should return the IDs of all the records
RecordQueryResult › getRecord
  ✅ should return the record with the given id
  ✅ should throw an error if the record does not exist
RecordQueryResult › getRecord › _filterRecordsById
  ✅ should filter out records that do not match the given IDs
  ✅ should remove all records if no matching IDs are provided
  ✅ should keep all records if all IDs match

✅ src/environment/sdk/globals/base/record/record.test.ts

Record
  ✅ should create a record with correct id and name
  ✅ should get cell value by a Field class
  ✅ should get cell value by field id
  ✅ should get cell value by field name
  ✅ should get cell value as string
  ✅ should throw error if field not found

✅ src/environment/sdk/globals/base/record/render-cell-as-string.test.ts

renderCellAsString
  ✅ should render barcode field correctly
  ✅ should render button field correctly
  ✅ should render checkbox field correctly
  ✅ should render multipleRecordLinks field correctly
  ✅ should render createdBy field correctly
  ✅ should render externalSyncSource field correctly
  ✅ should render lastModifiedBy field correctly
  ✅ should return value if field type is not recognized
  ✅ should render multipleAttachments field correctly
  ✅ should render multipleCollaborators field correctly
  ✅ should render multipleLookupValues field correctly
  ✅ should render rollup field correctly
  ✅ should render singleCollaborator field correctly
  ✅ should render singleSelect field correctly
renderCellAsString › createdTime
  ✅ should render createdTime field in date format
  ✅ should render createdTime field in US format with 12 hour time format
renderCellAsString › currency
  ✅ should render currency field with a precision of 4
  ✅ should render currency field with a precision of 0
  ✅ should render value as is if precision is not set
renderCellAsString › date
  ✅ should render date field in US format
  ✅ should render date field in European format
  ✅ should render date field in friendly format
renderCellAsString › dateTime
  ✅ should render dateTime field in US format with 12 hour time format
  ✅ should render dateTime field in US format with 24 hour time format
  ✅ should handle non-UTC timezones
renderCellAsString › duration
  ✅ should render duration with seconds
  ✅ should render duration with minutes
  ✅ should render duration with hours
renderCellAsString › lastModifiedTime
  ✅ should render lastModifiedTime field in date format
  ✅ should render lastModifiedTime field in US format with 12 hour time format
renderCellAsString › number
  ✅ should render number field with a precision of 4
  ✅ should render number field with a precision of 0
  ✅ should render value as is if precision is not set
renderCellAsString › percent
  ✅ should render percent field with a precision of 4
  ✅ should render percent field with a precision of 0
  ✅ should render value as is if precision is not set

✅ src/environment/sdk/globals/base/table.test.ts

Table
  ✅ should create a table with the correct properties
  ✅ should get a field by id or name
  ✅ should throw an error if field is not found
  ✅ should get a view by id or name
  ✅ should throw an error if view is not found
  ✅ should create a new field asynchronously
  ✅ should throw an error if field type is invalid
  ✅ should throw an error if field name already exists
Table › fields
  ✅ should persist changes to field properties
Table › selectRecordsAsync
  ✅ should select all records
  ✅ should select records with specified recordIds
  ✅ should sort records by ascending order
  ✅ should sort records by descending order
  ✅ should throw an error if a sort uses a missing field
  ✅ should throw an error if a sort uses a wrong direction
  ✅ should only include specifically stated fields
  ✅ should return all records if no options are specified
Table › selectRecordAsync
  ✅ should select a single record by ID
  ✅ should return null if the record is not found
  ✅ should only include specifically stated fields
Table › createRecordAsync
  ✅ should create a new record with valid fields
  ✅ should throw an error if a field does not exist
Table › createRecordsAsync
  ✅ should create multiple records with valid fields
  ✅ should throw an error if any field does not exist
Table › updateRecordAsync
  ✅ should update a record with valid fields
  ✅ should throw an error if the record does not exist
  ✅ should throw an error if a field does not exist
  ✅ should update a record using a Record instance
Table › updateRecordsAsync
  ✅ should update multiple records with valid fields
  ✅ should throw an error if any record does not exist
  ✅ should throw an error if any field does not exist
Table › deleteRecordAsync
  ✅ should delete a record by ID
  ✅ should delete a record by Record instance
  ✅ should throw an error if the record does not exist
Table › deleteRecordsAsync
  ✅ should delete multiple records by IDs
  ✅ should delete multiple records by Record instances
  ✅ should throw an error if any record does not exist

✅ src/environment/sdk/globals/base/view.test.ts

View
  ✅ should have the correct properties
View › selectRecordAsync
  ✅ should return null if the record is not found in the view
  ✅ should return the record if it is found in the view
  ✅ should limit fields in results
View › selectRecordsAsync
  ✅ should return only records found in the view

✅ src/environment/sdk/globals/cursor.test.ts

cursor
  ✅ should return null for activeTableId if __defaultCursor and __base are undefined
  ✅ should return null for activeViewId if __defaultCursor and __base are undefined
  ✅ should return tableId from __defaultCursor if defined
  ✅ should return viewId from __defaultCursor if defined
  ✅ should return first table id from __base if __defaultCursor is undefined
  ✅ should return first view id from __base if __defaultCursor is undefined
  ✅ should return null for activeTableId if __base has no tables
  ✅ should return null for activeViewId if __base has no tables

✅ src/environment/sdk/globals/input.test.ts

automationInput
  ✅ should return the results of a config callback
  ✅ should throw an error if no config callback is provided
extensionInput › textAsync
  ✅ should return the results of a textAsync callback
  ✅ should throw an error if no textAsync callback is provided
extensionInput › buttonsAsync
  ✅ should return the results of a buttonsAsync callback
  ✅ should throw an error if no buttonsAsync callback is provided
extensionInput › tableAsync
  ✅ should return the results of a tableAsync callback
  ✅ should throw an error if no tableAsync callback is provided
extensionInput › viewAsync
  ✅ should return the results of a viewAsync callback
  ✅ should accept a table object in the viewAsync method
  ✅ should throw an error if no viewAsync callback is provided
extensionInput › fieldAsync
  ✅ should return the results of a fieldAsync callback
  ✅ should throw an error if no fieldAsync callback is provided
extensionInput › recordAsync
  ✅ should return a record when given a Table object
  ✅ should return a record when given a View object
  ✅ should return a record when given a RecordQueryResult object
  ✅ should return a record when given an array of records
  ✅ should throw an error if given an invalid source
  ✅ should throw an error if no recordAsync callback is provided
extensionInput › fileAsync
  ✅ should return a text file without any parsed input
  ✅ should throw an error if no fileAsync callback is provided
extensionInput › config
  ✅ should return the results of a config callback
  ✅ should set an item with a Table object
  ✅ should set an item with a View object
  ✅ should set an item with a Field object
  ✅ should set a text item
  ✅ should set a number item
  ✅ should set a select item
  ✅ should throw an error if no config callback is provided

✅ src/environment/sdk/globals/output.test.ts

automationOutput
  ✅ should set key and value
extensionOutput
  ✅ should add text to output
  ✅ should add markdown to output
  ✅ should add table to output
  ✅ should add inspected object to output
  ✅ should clear the output

✅ src/environment/sdk/globals/session.test.ts

session
  ✅ should return null if __currentUser is undefined
  ✅ should return the current user if __currentUser is defined

✅ src/environment/sdk/lib/pascal-case.test.ts

pascalCase
  ✅ should convert a single word to pascal case
  ✅ should convert multiple words to pascal case
  ✅ should handle strings with mixed casing
  ✅ should handle strings with leading and trailing spaces
  ✅ should handle strings with multiple spaces between words
  ✅ should handle empty strings
  ✅ should handle strings with special characters

✅ src/environment/sdk/lib/uuid.test.ts

uuid
  ✅ should generate a UUID of the default length
  ✅ should generate a UUID of the specified length
  ✅ should generate a UUID containing only valid characters
  ✅ should generate unique UUIDs

✅ test/cell-format.test.ts

Cell string formatting › date
  ✅ formats a local string with the default date format
  ✅ formats a local string with an overwritten format if the date format is local

✅ test/console.test.ts

Console
  ✅ should collect a console.log
  ✅ should collect a console.error
  ✅ should collect a console.warn

✅ test/fetch.test.ts

Fetch
  ✅ implements a mock fetch
  ✅ implements a mock remoteFetchAsync
  ⚪ throws an error if remoteFetchAsync outside an extension script

✅ test/index.test.ts

Load records test
  ✅ base: getTable by name
  ✅ base: getTable by id
  ✅ accepts base objects not nested under a "base" property

✅ test/input.test.ts

Input › automation script
  ✅ passes a configuration object
Input › extension script
  ✅ passes a text item
  ✅ passes a buttonsAsync item
  ✅ passes a tableAsync item
  ✅ passes a viewAsync item
  ✅ passes a recordAsync item
  ✅ passes a fieldAsync item
  ✅ passes a fileAsync item
  ✅ passes a configuration object

✅ test/mutation-types.test.ts

Mutation types
  ✅ sets global mutation types

✅ test/mutations.test.ts

Mutations
  ✅ should track creating a new record
  ✅ should track deleting a record
  ✅ should track a change in a single field in a record
  ✅ should track a change in fields in a record
  ✅ should track a new table
  ✅ should track creating a new field
  ✅ should track updating a field name
  ✅ should track updating a field description
  ✅ should track updating a field options

✅ test/output.test.ts

Output
  ✅ passes multiple text outputs
  ✅ records a cleared output as another string

✅ test/session.test.ts

Session test
  ✅ allows getting the session data
  ✅ does not have active session information for automation scripts