This is a very basic example of a setup with Vite & Vitest.
See the AdapTable React Support Template for a full example of AdapTable React.
AdapTable React is the React Framework version of AdapTable - the market-leading, low-code AG Grid extension from AdapTable Tools.
For full information on how to use AdapTable React see the AdapTable Documentation.
The demo is built using these key packages:
This template contains just the bare bones required to set up an AdapTable instance with Vitest.
There are 3 important issues we fixed in this template:
vitest
requires ESM imports to include the file extension, so we had to install theextensionless
node module loader, since Adaptable (and probably most of your other dependencies) does not include the file extension in its internal imports. See thetest
script inpackage.json
.vitest
does not correctly read themodule
field in thepackage.json
of Adaptable, so we had to usepatch-package
to fix this issue and patch@adaptabletools/adaptable-react-aggrid
with the following lines in package.json
+ "exports": {
+ ".": "./src/index.js"
+ }
vitest
requires certain dependencies to be inlined during testing. We configure this using theserver.deps.inline
option to handle AdapTable's imports correctly. See Vitest Server Dependencies Configuration for more details:
server: {
deps: {
inline: [/@adaptabletools\/adaptable/],
}
}
This project uses patch-package to modify the @adaptabletools/adaptable-react-aggrid
package to work correctly with Vitest.
To make changes to a package:
- Make the required changes in
node_modules/@adaptabletools/adaptable-react-aggrid/package.json
- Run
npx patch-package @adaptabletools/adaptable-react-aggrid
to create a patch file - The patch will be saved in the
patches
directory
The patches are automatically applied after npm install
through the postinstall
script in package.json
.
Run npm install
(or yarn
), depending on what tool you're using.
Execute the following command
$ npm run start
Execute the following command
$ npm run test
See App.test.tsx
for an example test.
An AdapTable Licence provides access to all product features as well as quarterly updates and enhancements through the lifetime of the licence, comprehensive support, and access to all 3rd party libraries.
Licences can be purchased individually, for a team, for an organisation or for integration into software for onward sale.
We can make a Trial Licence available for a short period of time to allow you to try out AdapTable for yourself.
Please contact [email protected]
for more information.
Developers can learn how to access AdapTable programmatically at AdapTable Documentation.
Here you can see a large number of AdapTable demos each showing a different feature, function or option in AdapTable.
To see AdapTable in action visit our Demo Site which contains a few larger demos.
General information about Adaptable Tools is available at our Website.
For all support enquiries please raise a Support Ticket.