Skip to content

init test stack #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Run Tests

on:
pull_request: ~

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- run: yarn install --immutable
- run: yarn test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "yarn workspace @immutable/devtools-extension run dev",
"build": "yarn workspaces foreach --all -pt run build",
"test": "yarn workspaces foreach --all -pt run test",
"version": "node build/update-version.js && git add packages/extension/extension/manifest.json && git add packages/*/package.json && yarn"
},
"workspaces": [
Expand Down
7 changes: 7 additions & 0 deletions packages/devtools/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('jest').Config} */
const config = {
// ignore the files named "test.js"
testPathIgnorePatterns: ['<rootDir>/test.js'],
};

export default config;
4 changes: 3 additions & 1 deletion packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "rollup -c",
"prepublish": "npm run-script build",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest"
},
"keywords": [
"immutable",
Expand All @@ -22,9 +22,11 @@
"devDependencies": {
"@babel/core": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"@jest/globals": "^29.7.0",
"@rollup/plugin-babel": "^6.0.4",
"immutable": "^5.1.2",
"immutable3": "^3.8.1",
"jest": "^29.7.0",
"rollup": "^4.40.2"
},
"engines": {
Expand Down
27 changes: 27 additions & 0 deletions packages/devtools/src/createFormatter.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { describe, test, expect } from '@jest/globals';
import { List, isList } from 'immutable';
import createFormatters from './createFormatters';

describe('List', () => {
test('empty List', () => {
const list = List();

const { ListFormatter } = createFormatters({ List, isList });

const formatted = ListFormatter.header(list);
expect(formatted).toEqual([
'span',
[
'span',
{
style:
'color: light-dark(rgb(232,98,0), rgb(255, 150, 50)); position: relative',
},
'List',
],
['span', '[0]'],
]);

expect(ListFormatter.hasBody(list)).toBe(false);
});
});
1 change: 0 additions & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"description": "",
"exports": "./index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "rollup -c",
"dev": "rollup -c --watch"
},
Expand Down
Loading