Skip to content

Commit 814958f

Browse files
authored
Merge branch 'master' into fix/nav-while-editing
2 parents d83ff0f + 4cbcd7a commit 814958f

File tree

86 files changed

+21139
-3819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+21139
-3819
lines changed

.babelrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/playwright.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [18, 20, 22]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Install Playwright Browsers
22+
run: npx playwright install --with-deps
23+
- name: Build dist files
24+
run: npm run build
25+
- name: Run Playwright tests
26+
run: npx playwright test
27+
- uses: actions/upload-artifact@v4
28+
if: ${{ !cancelled() }}
29+
with:
30+
name: playwright-report-node-${{ matrix.node-version }}
31+
path: playwright-report/
32+
retention-days: 30

.github/workflows/unit-tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Unit Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [18, 20, 22]
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- name: Install modules
20+
run: npm install
21+
- name: Run tests
22+
run: npm run test:unit

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@
33

44
node_modules/
55
examples/
6-
npm-debug.log
6+
npm-debug.log
7+
8+
# Playwright
9+
/test-results/
10+
/playwright-report/
11+
/blob-report/
12+
/playwright/.cache/

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,22 @@ To access Tabulator directly from the UNPKG CDN servers, include the following t
7474
<link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet">
7575
<script type="text/javascript" src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script>
7676
```
77+
78+
Testing
79+
================================
80+
Tabulator comes with both Unit and End-to-End (E2E) tests. Here’s how you can run them:
81+
82+
```bash
83+
# Unit test
84+
npm run test:unit
85+
86+
# E2E test
87+
npm run build # Make sure to build the project first
88+
npx playwright test # Run the tests
89+
# or
90+
npm run test:e2e
91+
92+
# Run all tests
93+
npm run test
94+
```
95+

babel.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = (api) => {
2+
if (api.env("test")) {
3+
return {
4+
presets: [["@babel/preset-env", { targets: { node: "current" } }]],
5+
};
6+
}
7+
8+
return {
9+
presets: [["@babel/env", { modules: false }]],
10+
};
11+
};

eslint.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const {
2+
defineConfig,
3+
globalIgnores,
4+
} = require("eslint/config");
5+
6+
const globals = require("globals");
7+
8+
module.exports = defineConfig([{
9+
languageOptions: {
10+
globals: {
11+
...globals.browser,
12+
...globals.node,
13+
...globals.amd,
14+
"luxon": "readonly",
15+
"XLSX": "readonly",
16+
"jspdf": "readonly",
17+
},
18+
19+
"ecmaVersion": "latest",
20+
"sourceType": "module",
21+
parserOptions: {},
22+
},
23+
24+
"rules": {
25+
"semi": "error",
26+
27+
"indent": ["error", "tab", {
28+
VariableDeclarator: 0,
29+
"SwitchCase": 1,
30+
}],
31+
32+
"no-unused-vars": ["warn", {
33+
"vars": "all",
34+
"args": "none",
35+
"ignoreRestSiblings": false,
36+
}],
37+
38+
"no-fallthrough": "off",
39+
"no-inner-declarations": "off",
40+
"no-prototype-builtins": "off",
41+
42+
"no-empty": ["error", {
43+
"allowEmptyCatch": true,
44+
}],
45+
},
46+
}, globalIgnores(["**/.eslintrc.js", "**/dist", "**/examples"])]);

jest.config.js

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
/**
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
/** @type {import('jest').Config} */
7+
const config = {
8+
// All imported modules in your tests should be mocked automatically
9+
// automock: false,
10+
11+
// Stop running tests after `n` failures
12+
// bail: 0,
13+
14+
// The directory where Jest should store its cached dependency information
15+
// cacheDirectory: "/tmp/jest_rs",
16+
17+
// Automatically clear mock calls, instances, contexts and results before every test
18+
// clearMocks: false,
19+
20+
// Indicates whether the coverage information should be collected while executing the test
21+
// collectCoverage: false,
22+
23+
// An array of glob patterns indicating a set of files for which coverage information should be collected
24+
// collectCoverageFrom: undefined,
25+
26+
// The directory where Jest should output its coverage files
27+
// coverageDirectory: undefined,
28+
29+
// An array of regexp pattern strings used to skip coverage collection
30+
// coveragePathIgnorePatterns: [
31+
// "/node_modules/"
32+
// ],
33+
34+
// Indicates which provider should be used to instrument code for coverage
35+
// coverageProvider: "babel",
36+
37+
// A list of reporter names that Jest uses when writing coverage reports
38+
// coverageReporters: [
39+
// "json",
40+
// "text",
41+
// "lcov",
42+
// "clover"
43+
// ],
44+
45+
// An object that configures minimum threshold enforcement for coverage results
46+
// coverageThreshold: undefined,
47+
48+
// A path to a custom dependency extractor
49+
// dependencyExtractor: undefined,
50+
51+
// Make calling deprecated APIs throw helpful error messages
52+
// errorOnDeprecated: false,
53+
54+
// The default configuration for fake timers
55+
// fakeTimers: {
56+
// "enableGlobally": false
57+
// },
58+
59+
// Force coverage collection from ignored files using an array of glob patterns
60+
// forceCoverageMatch: [],
61+
62+
// A path to a module which exports an async function that is triggered once before all test suites
63+
// globalSetup: undefined,
64+
65+
// A path to a module which exports an async function that is triggered once after all test suites
66+
// globalTeardown: undefined,
67+
68+
// A set of global variables that need to be available in all test environments
69+
// globals: {},
70+
71+
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72+
// maxWorkers: "50%",
73+
74+
// An array of directory names to be searched recursively up from the requiring module's location
75+
// moduleDirectories: [
76+
// "node_modules"
77+
// ],
78+
79+
// An array of file extensions your modules use
80+
// moduleFileExtensions: [
81+
// "js",
82+
// "mjs",
83+
// "cjs",
84+
// "jsx",
85+
// "ts",
86+
// "tsx",
87+
// "json",
88+
// "node"
89+
// ],
90+
91+
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92+
// moduleNameMapper: {},
93+
94+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
95+
// modulePathIgnorePatterns: [],
96+
97+
// Activates notifications for test results
98+
// notify: false,
99+
100+
// An enum that specifies notification mode. Requires { notify: true }
101+
// notifyMode: "failure-change",
102+
103+
// A preset that is used as a base for Jest's configuration
104+
// preset: undefined,
105+
106+
// Run tests from one or more projects
107+
// projects: undefined,
108+
109+
// Use this configuration option to add custom reporters to Jest
110+
// reporters: undefined,
111+
112+
// Automatically reset mock state before every test
113+
// resetMocks: false,
114+
115+
// Reset the module registry before running each individual test
116+
// resetModules: false,
117+
118+
// A path to a custom resolver
119+
// resolver: undefined,
120+
121+
// Automatically restore mock state and implementation before every test
122+
// restoreMocks: false,
123+
124+
// The root directory that Jest should scan for tests and modules within
125+
// rootDir: undefined,
126+
127+
// A list of paths to directories that Jest should use to search for files in
128+
roots: [
129+
"<rootDir>/test/unit",
130+
],
131+
132+
// Allows you to use a custom runner instead of Jest's default test runner
133+
// runner: "jest-runner",
134+
135+
// The paths to modules that run some code to configure or set up the testing environment before each test
136+
// setupFiles: [],
137+
138+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
139+
setupFilesAfterEnv: ['<rootDir>/test/unit/setup.js'],
140+
141+
// The number of seconds after which a test is considered as slow and reported as such in the results.
142+
// slowTestThreshold: 5,
143+
144+
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
145+
// snapshotSerializers: [],
146+
147+
// The test environment that will be used for testing
148+
testEnvironment: "jsdom",
149+
150+
// Options that will be passed to the testEnvironment
151+
// testEnvironmentOptions: {},
152+
153+
// Adds a location field to test results
154+
// testLocationInResults: false,
155+
156+
// The glob patterns Jest uses to detect test files
157+
// testMatch: [
158+
// "**/__tests__/**/*.[jt]s?(x)",
159+
// "**/?(*.)+(spec|test).[tj]s?(x)"
160+
// ],
161+
162+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163+
// testPathIgnorePatterns: [
164+
// "/node_modules/"
165+
// ],
166+
167+
// The regexp pattern or array of patterns that Jest uses to detect test files
168+
// testRegex: [],
169+
170+
// This option allows the use of a custom results processor
171+
// testResultsProcessor: undefined,
172+
173+
// This option allows use of a custom test runner
174+
// testRunner: "jest-circus/runner",
175+
176+
// A map from regular expressions to paths to transformers
177+
// transform: undefined,
178+
179+
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
180+
// transformIgnorePatterns: [
181+
// "/node_modules/",
182+
// "\\.pnp\\.[^\\/]+$"
183+
// ],
184+
185+
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
186+
// unmockedModulePathPatterns: undefined,
187+
188+
// Indicates whether each individual test should be reported during the run
189+
// verbose: undefined,
190+
191+
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
192+
// watchPathIgnorePatterns: [],
193+
194+
// Whether to use watchman for file crawling
195+
// watchman: true,
196+
};
197+
198+
module.exports = config;

0 commit comments

Comments
 (0)