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:
vitestrequires ESM imports to include the file extension, so we had to install theextensionlessnode module loader, since Adaptable (and probably most of your other dependencies) does not include the file extension in its internal imports. See thetestscript inpackage.json.vitestdoes not correctly read themodulefield in thepackage.jsonof Adaptable, so we had to usepatch-packageto fix this issue and patch@adaptabletools/adaptable-react-aggridwith the following lines in package.json
+ "exports": {
+ ".": "./src/index.js"
+ }vitestrequires certain dependencies to be inlined during testing. We configure this using theserver.deps.inlineoption 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-aggridto create a patch file - The patch will be saved in the
patchesdirectory
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 startExecute the following command
$ npm run testSee 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.