diff --git a/eslint.config.mjs b/eslint.config.mjs index 4ad499b35..c12ac554b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,32 +5,39 @@ import tseslint from "typescript-eslint"; // For documentation see // https://typescript-eslint.io/packages/typescript-eslint#config -export default tseslint.config({ - extends: [ - eslint.configs.recommended, - jsdoc.configs['flat/recommended'], - ...tseslint.configs.recommended - ], - languageOptions: { - parserOptions: { - project: true, +export default tseslint.config( + { + extends: [ + eslint.configs.recommended, + jsdoc.configs['flat/recommended'], + ...tseslint.configs.recommended + ], + languageOptions: { + parserOptions: { + project: true, + } + }, + files: ['**/*.ts'], + ignores: ["**/*.d.ts", "**/*.js", "**/cjs/*"], + "rules": { + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": ["error", + { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" } + ], + "@typescript-eslint/no-empty-object-type": ["error", {"allowInterfaces": "with-single-extends"}], + "@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }], + "prefer-const": ["error", {"destructuring": "all"}], + "jsdoc/tag-lines": ["warn", "always", {"count": 0, "startLines": 1}], + "jsdoc/reject-any-type": "off", + "jsdoc/reject-function-type": "off" } }, - files: ['ts/**/*.ts'], - ignores: ["**/*.d.ts", "**/*.js", "**/cjs/*"], - "rules": { - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": ["error", - { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", - "caughtErrorsIgnorePattern": "^_" } - ], - "@typescript-eslint/no-empty-object-type": ["error", {"allowInterfaces": "with-single-extends"}], - "@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }], - "prefer-const": ["error", {"destructuring": "all"}], - "jsdoc/tag-lines": ["warn", "always", {"count": 0, "startLines": 1}], - "jsdoc/reject-any-type": "off", - "jsdoc/reject-function-type": "off" + { + files: ['**/*.test.ts'], + rules: { + "jsdoc/require-jsdoc": "off" + } } -}); - +); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb9d6519a..0c55b8a1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,8 +85,198 @@ importers: specifier: ^2.7.0 version: 2.7.0 + testsuite: + dependencies: + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 + '@mathjax/mathjax-bbm-font-extension': + specifier: ^4.1.1 + version: 4.1.1 + '@types/jest': + specifier: ^29.5.14 + version: 29.5.14 + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + ts-jest: + specifier: ^29.4.6 + version: 29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)))(typescript@5.9.3) + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@25.2.3)(typescript@5.9.3) + packages: + '@babel/code-frame@7.29.0': + resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.29.0': + resolution: {integrity: sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.29.0': + resolution: {integrity: sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.29.1': + resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.28.6': + resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-globals@7.28.0': + resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.28.6': + resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.28.6': + resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-plugin-utils@7.28.6': + resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.27.1': + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.27.1': + resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.29.2': + resolution: {integrity: sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.2': + resolution: {integrity: sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-syntax-async-generators@7.8.4': + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-bigint@7.8.3': + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-properties@7.12.13': + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-class-static-block@7.14.5': + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.28.6': + resolution: {integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-json-strings@7.8.3': + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-jsx@7.28.6': + resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3': + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-numeric-separator@7.10.4': + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-object-rest-spread@7.8.3': + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3': + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-optional-chaining@7.8.3': + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-private-property-in-object@7.14.5': + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-top-level-await@7.14.5': + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-typescript@7.28.6': + resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/template@7.28.6': + resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.29.0': + resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.29.0': + resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} + engines: {node: '>=6.9.0'} + + '@bcoe/v8-coverage@0.2.3': + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + '@discoveryjs/json-ext@0.6.3': resolution: {integrity: sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==} engines: {node: '>=14.17.0'} @@ -160,9 +350,86 @@ packages: resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==} engines: {node: '>=18'} + '@istanbuljs/load-nyc-config@1.1.0': + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + + '@istanbuljs/schema@0.1.3': + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + + '@jest/console@29.7.0': + resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/core@29.7.0': + resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/environment@29.7.0': + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect-utils@29.7.0': + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/expect@29.7.0': + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/fake-timers@29.7.0': + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/globals@29.7.0': + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/reporters@29.7.0': + resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + '@jest/schemas@29.6.3': + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/source-map@29.6.3': + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-result@29.7.0': + resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/test-sequencer@29.7.0': + resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/transform@29.7.0': + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + '@jest/types@29.6.3': + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -176,6 +443,12 @@ packages: '@jridgewell/trace-mapping@0.3.31': resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + + '@mathjax/mathjax-bbm-font-extension@4.1.1': + resolution: {integrity: sha512-TGH3Tf/CWMBNBgg6XXCt2eQdtabfJ96eMkLnvZYvqD4OEw1loqMMTCWDCYbnyZonUTZtqRtX00X14SuLnDOJ6w==} + '@mathjax/mathjax-newcm-font@4.1.1': resolution: {integrity: sha512-LeV5AWzoR7k/k2tg5mW0Ad3Jr9oK9guW/zBUIP8aoiIZcZIhvAV9dlbtUSqSe1wgEBUP1KOcJXcrE/NxOqkxlQ==} @@ -198,10 +471,43 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} + '@sinclair/typebox@0.27.10': + resolution: {integrity: sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==} + '@sindresorhus/base62@1.0.0': resolution: {integrity: sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==} engines: {node: '>=18'} + '@sinonjs/commons@3.0.1': + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + + '@sinonjs/fake-timers@10.3.0': + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + + '@tsconfig/node10@1.0.12': + resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -211,18 +517,42 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@types/graceful-fs@4.1.9': + resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/node@25.2.3': resolution: {integrity: sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==} + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@17.0.35': + resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} + '@typescript-eslint/eslint-plugin@8.56.0': resolution: {integrity: sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -377,6 +707,10 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-walk@8.3.5: + resolution: {integrity: sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==} + engines: {node: '>=0.4.0'} + acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} @@ -401,6 +735,10 @@ packages: ajv@8.18.0: resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + ansi-escapes@7.3.0: resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} engines: {node: '>=18'} @@ -417,14 +755,28 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + ansi-styles@6.2.3: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + are-docs-informative@0.0.2: resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} engines: {node: '>=14'} + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -434,6 +786,31 @@ packages: axios@1.13.5: resolution: {integrity: sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==} + babel-jest@29.7.0: + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + + babel-plugin-istanbul@6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + + babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + babel-preset-current-node-syntax@1.2.0: + resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} + peerDependencies: + '@babel/core': ^7.0.0 || ^8.0.0-0 + + babel-preset-jest@29.6.3: + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -464,6 +841,13 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + bs-logger@0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -475,6 +859,14 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + caniuse-lite@1.0.30001770: resolution: {integrity: sha512-x/2CLQ1jHENRbHg5PSId2sXq1CIO1CISvwWAj027ltMVG2UNgW+w9oH2+HzgEIRFembL8bUlXtfbBHR1fCg2xw==} @@ -482,10 +874,21 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + chrome-trace-event@1.0.4: resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==} engines: {node: '>=6.0'} + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + + cjs-module-lexer@1.4.3: + resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} @@ -497,10 +900,21 @@ packages: cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + clone-deep@4.0.1: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + + collect-v8-coverage@1.0.3: + resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -537,6 +951,9 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + copyfiles@2.4.1: resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} hasBin: true @@ -544,6 +961,14 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + create-jest@29.7.0: + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -557,13 +982,37 @@ packages: supports-color: optional: true + dedent@1.7.2: + resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} + detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + + diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + diff@4.0.4: + resolution: {integrity: sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==} + engines: {node: '>=0.3.1'} + diff@8.0.3: resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==} engines: {node: '>=0.3.1'} @@ -575,6 +1024,10 @@ packages: electron-to-chromium@1.5.286: resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==} + emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -598,6 +1051,9 @@ packages: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -621,6 +1077,10 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -687,6 +1147,11 @@ packages: resolution: {integrity: sha512-WFWYhO1fV4iYkqOOvq8FbqIhr2pYfoDY0kCotMkDeNtGpiGGkZ1iov2u8ydjtgM8yF8rzK7oaTbw2NAzbAbehw==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + esquery@1.7.0: resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} @@ -714,6 +1179,18 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + + expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -733,6 +1210,9 @@ packages: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -785,9 +1265,18 @@ packages: fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -800,10 +1289,18 @@ packages: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + get-proto@1.0.1: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} @@ -830,6 +1327,11 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + handlebars@4.7.8: + resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} + engines: {node: '>=0.4.7'} + hasBin: true + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -849,6 +1351,13 @@ packages: html-entities@2.6.0: resolution: {integrity: sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==} + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} @@ -886,6 +1395,9 @@ packages: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} @@ -902,6 +1414,10 @@ packages: resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} + is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -914,6 +1430,10 @@ packages: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + isarray@0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} @@ -927,14 +1447,174 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + + istanbul-lib-instrument@6.0.3: + resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + engines: {node: '>=10'} + + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} + + istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} + jackspeak@4.2.3: resolution: {integrity: sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==} engines: {node: 20 || >=22} + jest-changed-files@29.7.0: + resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-circus@29.7.0: + resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-cli@29.7.0: + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + jest-config@29.7.0: + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + + jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-docblock@29.7.0: + resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-each@29.7.0: + resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-leak-detector@29.7.0: + resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-pnp-resolver@1.2.3: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + + jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve-dependencies@29.7.0: + resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-resolve@29.7.0: + resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runner@29.7.0: + resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-runtime@29.7.0: + resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest-watcher@29.7.0: + resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} + jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + + jest@29.7.0: + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} + hasBin: true + js-yaml@4.1.1: resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true @@ -943,6 +1623,11 @@ packages: resolution: {integrity: sha512-/2uqY7x6bsrpi3i9LVU6J89352C0rpMk0as8trXxCtvd4kPk1ke/Eyif6wqfSLvoNJqcDG9Vk4UsXgygzCt2xA==} engines: {node: '>=20.0.0'} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -958,6 +1643,11 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -965,10 +1655,21 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + linkify-it@5.0.0: resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} @@ -993,6 +1694,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.memoize@4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -1004,10 +1708,23 @@ packages: resolution: {integrity: sha512-ESL2CrkS/2wTPfuend7Zhkzo2u0daGJ/A2VucJOgQ/C48S/zB8MMeMHSGKYpXhIjbPxfuezITkaBH1wqv00DDQ==} engines: {node: 20 || >=22} + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + lunr@2.3.9: resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} - markdown-it@14.1.1: + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + engines: {node: '>=10'} + + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + + markdown-it@14.1.1: resolution: {integrity: sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA==} hasBin: true @@ -1036,6 +1753,10 @@ packages: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + mimic-function@5.0.1: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} @@ -1051,6 +1772,9 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -1076,18 +1800,33 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} noms@0.0.0: resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + object-deep-merge@2.0.0: resolution: {integrity: sha512-3DC3UMpeffLTHiuXSy/UG4NOIYTLlY9u3V82+djSCLYClWobZiS4ivYzpIUWrRY/nfsJ8cWsKyG3QfyLePmhvg==} once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + onetime@7.0.0: resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} @@ -1126,6 +1865,10 @@ packages: parse-imports-exports@0.2.4: resolution: {integrity: sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==} + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + parse-statements@1.0.11: resolution: {integrity: sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==} @@ -1164,6 +1907,10 @@ packages: engines: {node: '>=0.10'} hasBin: true + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -1181,9 +1928,17 @@ packages: engines: {node: '>=14'} hasBin: true + pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -1195,9 +1950,15 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + readable-stream@1.0.34: resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} @@ -1232,6 +1993,10 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + engines: {node: '>=10'} + resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} @@ -1262,6 +2027,10 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + semver@7.7.4: resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} engines: {node: '>=10'} @@ -1282,14 +2051,27 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + slice-ansi@7.1.2: resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} + source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -1310,10 +2092,21 @@ packages: resolution: {integrity: sha512-ohK2DizQ9s/JeiHhIraATNBwYpg2jSlSIF4Sq8pgHgSqMq2tkLRZLUq1BT2DjnmCWzkKeGSOaz6t/KzDGRGhPg==} hasBin: true + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} + string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -1340,6 +2133,14 @@ packages: resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -1385,6 +2186,10 @@ packages: engines: {node: '>=10'} hasBin: true + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} @@ -1392,6 +2197,9 @@ packages: resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -1406,10 +2214,63 @@ packages: peerDependencies: typescript: '>=4.8.4' + ts-jest@29.4.6: + resolution: {integrity: sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 || ^30.0.0 + '@jest/types': ^29.0.0 || ^30.0.0 + babel-jest: ^29.0.0 || ^30.0.0 + esbuild: '*' + jest: ^29.0.0 || ^30.0.0 + jest-util: ^29.0.0 || ^30.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + jest-util: + optional: true + + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + typedoc@0.28.17: resolution: {integrity: sha512-ZkJ2G7mZrbxrKxinTQMjFqsCoYY6a5Luwv2GKbTnBCEgV2ihYm5CflA9JnJAwH0pZWavqfYxmDkFHPt4yx2oDQ==} engines: {node: '>= 18', pnpm: '>= 10'} @@ -1436,6 +2297,11 @@ packages: uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + uglify-js@3.19.3: + resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} + engines: {node: '>=0.8.0'} + hasBin: true + undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} @@ -1455,6 +2321,16 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + watchpack@2.5.1: resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} @@ -1506,6 +2382,9 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wordwrap@1.0.0: + resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -1517,6 +2396,10 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + xslt3@2.7.0: resolution: {integrity: sha512-Vt32LhCt4CQULtGPWlGW++PhS+o3LA6z3PDvig9lDfbo2cIHcaEnyrRYDTilw4N0EbAyxCaw5E0B+DICZEYktQ==} hasBin: true @@ -1529,6 +2412,9 @@ packages: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yaml@2.8.2: resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} engines: {node: '>= 14.6'} @@ -1538,16 +2424,221 @@ packages: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} snapshots: + '@babel/code-frame@7.29.0': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.0': {} + + '@babel/core@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-compilation-targets': 7.28.6 + '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0) + '@babel/helpers': 7.29.2 + '@babel/parser': 7.29.2 + '@babel/template': 7.28.6 + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.1': + dependencies: + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.28.6': + dependencies: + '@babel/compat-data': 7.29.0 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.28.1 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.28.0': {} + + '@babel/helper-module-imports@7.28.6': + dependencies: + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.28.6': {} + + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.28.5': {} + + '@babel/helper-validator-option@7.27.1': {} + + '@babel/helpers@7.29.2': + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + + '@babel/parser@7.29.2': + dependencies: + '@babel/types': 7.29.0 + + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-import-attributes@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/template@7.28.6': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + + '@babel/traverse@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.29.2 + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.0': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + + '@bcoe/v8-coverage@0.2.3': {} + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + '@discoveryjs/json-ext@0.6.3': {} '@es-joy/jsdoccomment@0.84.0': @@ -1627,11 +2718,188 @@ snapshots: '@isaacs/cliui@9.0.0': {} + '@istanbuljs/load-nyc-config@1.1.0': + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.2 + resolve-from: 5.0.0 + + '@istanbuljs/schema@0.1.3': {} + + '@jest/console@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + chalk: 4.1.2 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + + '@jest/environment@29.7.0': + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + jest-mock: 29.7.0 + + '@jest/expect-utils@29.7.0': + dependencies: + jest-get-type: 29.6.3 + + '@jest/expect@29.7.0': + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/fake-timers@29.7.0': + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 25.2.3 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + '@jest/globals@29.7.0': + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 + transitivePeerDependencies: + - supports-color + + '@jest/reporters@29.7.0': + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + '@types/node': 25.2.3 + chalk: 4.1.2 + collect-v8-coverage: 1.0.3 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.3 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.2.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.3.0 + transitivePeerDependencies: + - supports-color + + '@jest/schemas@29.6.3': + dependencies: + '@sinclair/typebox': 0.27.10 + + '@jest/source-map@29.6.3': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + callsites: 3.1.0 + graceful-fs: 4.2.11 + + '@jest/test-result@29.7.0': + dependencies: + '@jest/console': 29.7.0 + '@jest/types': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + collect-v8-coverage: 1.0.3 + + '@jest/test-sequencer@29.7.0': + dependencies: + '@jest/test-result': 29.7.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + slash: 3.0.0 + + '@jest/transform@29.7.0': + dependencies: + '@babel/core': 7.29.0 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.31 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.8 + pirates: 4.0.7 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + + '@jest/types@29.6.3': + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 25.2.3 + '@types/yargs': 17.0.35 + chalk: 4.1.2 + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/source-map@0.3.11': @@ -1646,6 +2914,13 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@mathjax/mathjax-bbm-font-extension@4.1.1': {} + '@mathjax/mathjax-newcm-font@4.1.1': {} '@pkgr/core@0.2.9': {} @@ -1670,8 +2945,47 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} + '@sinclair/typebox@0.27.10': {} + '@sindresorhus/base62@1.0.0': {} + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 + + '@sinonjs/fake-timers@10.3.0': + dependencies: + '@sinonjs/commons': 3.0.1 + + '@tsconfig/node10@1.0.12': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + + '@types/babel__core@7.20.5': + dependencies: + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + '@types/babel__generator': 7.27.0 + '@types/babel__template': 7.4.4 + '@types/babel__traverse': 7.28.0 + + '@types/babel__generator@7.27.0': + dependencies: + '@babel/types': 7.29.0 + + '@types/babel__template@7.4.4': + dependencies: + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + + '@types/babel__traverse@7.28.0': + dependencies: + '@babel/types': 7.29.0 + '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 @@ -1684,18 +2998,45 @@ snapshots: '@types/estree@1.0.8': {} + '@types/graceful-fs@4.1.9': + dependencies: + '@types/node': 25.2.3 + '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 + '@types/istanbul-lib-coverage@2.0.6': {} + + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + + '@types/jest@29.5.14': + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + '@types/json-schema@7.0.15': {} '@types/node@25.2.3': dependencies: undici-types: 7.16.0 + '@types/stack-utils@2.0.3': {} + '@types/unist@3.0.3': {} + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@17.0.35': + dependencies: + '@types/yargs-parser': 21.0.3 + '@typescript-eslint/eslint-plugin@8.56.0(@typescript-eslint/parser@8.56.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -1894,6 +3235,10 @@ snapshots: dependencies: acorn: 8.15.0 + acorn-walk@8.3.5: + dependencies: + acorn: 8.15.0 + acorn@8.15.0: {} ajv-formats@2.1.1(ajv@8.18.0): @@ -1919,6 +3264,10 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 + ansi-escapes@4.3.2: + dependencies: + type-fest: 0.21.3 + ansi-escapes@7.3.0: dependencies: environment: 1.1.0 @@ -1931,10 +3280,23 @@ snapshots: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + ansi-styles@6.2.3: {} + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + are-docs-informative@0.0.2: {} + arg@4.1.3: {} + + argparse@1.0.10: + dependencies: + sprintf-js: 1.0.3 + argparse@2.0.1: {} asynckit@0.4.0: {} @@ -1947,6 +3309,61 @@ snapshots: transitivePeerDependencies: - debug + babel-jest@29.7.0(@babel/core@7.29.0): + dependencies: + '@babel/core': 7.29.0 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.29.0) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-istanbul@6.1.1: + dependencies: + '@babel/helper-plugin-utils': 7.28.6 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + + babel-plugin-jest-hoist@29.6.3: + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + '@types/babel__core': 7.20.5 + '@types/babel__traverse': 7.28.0 + + babel-preset-current-node-syntax@1.2.0(@babel/core@7.29.0): + dependencies: + '@babel/core': 7.29.0 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.29.0) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.29.0) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.29.0) + '@babel/plugin-syntax-import-attributes': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.29.0) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.29.0) + + babel-preset-jest@29.6.3(@babel/core@7.29.0): + dependencies: + '@babel/core': 7.29.0 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.0) + balanced-match@1.0.2: {} balanced-match@4.0.2: @@ -1980,6 +3397,14 @@ snapshots: node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) + bs-logger@0.2.6: + dependencies: + fast-json-stable-stringify: 2.1.0 + + bser@2.1.1: + dependencies: + node-int64: 0.4.0 + buffer-from@1.1.2: {} call-bind-apply-helpers@1.0.2: @@ -1989,6 +3414,10 @@ snapshots: callsites@3.1.0: {} + camelcase@5.3.1: {} + + camelcase@6.3.0: {} + caniuse-lite@1.0.30001770: {} chalk@4.1.2: @@ -1996,8 +3425,14 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + char-regex@1.0.2: {} + chrome-trace-event@1.0.4: {} + ci-info@3.9.0: {} + + cjs-module-lexer@1.4.3: {} + cli-cursor@5.0.0: dependencies: restore-cursor: 5.1.0 @@ -2013,12 +3448,22 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + clone-deep@4.0.1: dependencies: is-plain-object: 2.0.4 kind-of: 6.0.3 shallow-clone: 3.0.1 + co@4.6.0: {} + + collect-v8-coverage@1.0.3: {} + color-convert@2.0.1: dependencies: color-name: 1.1.4 @@ -2043,6 +3488,8 @@ snapshots: concat-map@0.0.1: {} + convert-source-map@2.0.0: {} + copyfiles@2.4.1: dependencies: glob: 7.2.3 @@ -2055,6 +3502,23 @@ snapshots: core-util-is@1.0.3: {} + create-jest@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-require@1.1.1: {} + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -2065,10 +3529,20 @@ snapshots: dependencies: ms: 2.1.3 + dedent@1.7.2: {} + deep-is@0.1.4: {} + deepmerge@4.3.1: {} + delayed-stream@1.0.0: {} + detect-newline@3.1.0: {} + + diff-sequences@29.6.3: {} + + diff@4.0.4: {} + diff@8.0.3: {} dunder-proto@1.0.1: @@ -2079,6 +3553,8 @@ snapshots: electron-to-chromium@1.5.286: {} + emittery@0.13.1: {} + emoji-regex@10.6.0: {} emoji-regex@8.0.0: {} @@ -2094,6 +3570,10 @@ snapshots: environment@1.1.0: {} + error-ex@1.3.4: + dependencies: + is-arrayish: 0.2.1 + es-define-property@1.0.1: {} es-errors@1.3.0: {} @@ -2113,6 +3593,8 @@ snapshots: escalade@3.2.0: {} + escape-string-regexp@2.0.0: {} + escape-string-regexp@4.0.0: {} eslint-formatter-unix@9.0.1: {} @@ -2213,6 +3695,8 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 5.0.0 + esprima@4.0.1: {} + esquery@1.7.0: dependencies: estraverse: 5.3.0 @@ -2231,6 +3715,28 @@ snapshots: events@3.3.0: {} + execa@5.1.1: + dependencies: + cross-spawn: 7.0.6 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + + exit@0.1.2: {} + + expect@29.7.0: + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + fast-deep-equal@3.1.3: {} fast-diff@1.3.0: {} @@ -2243,6 +3749,10 @@ snapshots: fastest-levenshtein@1.0.16: {} + fb-watchman@2.0.2: + dependencies: + bser: 2.1.1 + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -2286,8 +3796,13 @@ snapshots: fs.realpath@1.0.0: {} + fsevents@2.3.3: + optional: true + function-bind@1.1.2: {} + gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} get-east-asian-width@1.4.0: {} @@ -2305,11 +3820,15 @@ snapshots: hasown: 2.0.2 math-intrinsics: 1.1.0 + get-package-type@0.1.0: {} + get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + get-stream@6.0.1: {} + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 @@ -2337,6 +3856,15 @@ snapshots: graceful-fs@4.2.11: {} + handlebars@4.7.8: + dependencies: + minimist: 1.2.8 + neo-async: 2.6.2 + source-map: 0.6.1 + wordwrap: 1.0.0 + optionalDependencies: + uglify-js: 3.19.3 + has-flag@4.0.0: {} has-symbols@1.1.0: {} @@ -2351,6 +3879,10 @@ snapshots: html-entities@2.6.0: {} + html-escaper@2.0.2: {} + + human-signals@2.1.0: {} + husky@9.1.7: {} ignore@5.3.2: {} @@ -2378,6 +3910,8 @@ snapshots: interpret@3.1.1: {} + is-arrayish@0.2.1: {} + is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -2390,6 +3924,8 @@ snapshots: dependencies: get-east-asian-width: 1.4.0 + is-generator-fn@2.1.0: {} + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -2400,6 +3936,8 @@ snapshots: dependencies: isobject: 3.0.1 + is-stream@2.0.1: {} + isarray@0.0.1: {} isarray@1.0.0: {} @@ -2408,22 +3946,381 @@ snapshots: isobject@3.0.1: {} + istanbul-lib-coverage@3.2.2: {} + + istanbul-lib-instrument@5.2.1: + dependencies: + '@babel/core': 7.29.0 + '@babel/parser': 7.29.2 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + istanbul-lib-instrument@6.0.3: + dependencies: + '@babel/core': 7.29.0 + '@babel/parser': 7.29.2 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 7.7.4 + transitivePeerDependencies: + - supports-color + + istanbul-lib-report@3.0.1: + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + + istanbul-lib-source-maps@4.0.1: + dependencies: + debug: 4.4.3 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + + istanbul-reports@3.2.0: + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + jackspeak@4.2.3: dependencies: '@isaacs/cliui': 9.0.0 + jest-changed-files@29.7.0: + dependencies: + execa: 5.1.1 + jest-util: 29.7.0 + p-limit: 3.1.0 + + jest-circus@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + chalk: 4.1.2 + co: 4.6.0 + dedent: 1.7.2 + is-generator-fn: 2.1.0 + jest-each: 29.7.0 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + p-limit: 3.1.0 + pretty-format: 29.7.0 + pure-rand: 6.1.0 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-cli@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-config@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)): + dependencies: + '@babel/core': 7.29.0 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.29.0) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 25.2.3 + ts-node: 10.9.2(@types/node@25.2.3)(typescript@5.9.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-diff@29.7.0: + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-docblock@29.7.0: + dependencies: + detect-newline: 3.1.0 + + jest-each@29.7.0: + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + jest-get-type: 29.6.3 + jest-util: 29.7.0 + pretty-format: 29.7.0 + + jest-environment-node@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + jest-mock: 29.7.0 + jest-util: 29.7.0 + + jest-get-type@29.6.3: {} + + jest-haste-map@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.9 + '@types/node': 25.2.3 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.8 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + + jest-leak-detector@29.7.0: + dependencies: + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-matcher-utils@29.7.0: + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + + jest-message-util@29.7.0: + dependencies: + '@babel/code-frame': 7.29.0 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + + jest-mock@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + jest-util: 29.7.0 + + jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): + optionalDependencies: + jest-resolve: 29.7.0 + + jest-regex-util@29.6.3: {} + + jest-resolve-dependencies@29.7.0: + dependencies: + jest-regex-util: 29.6.3 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + + jest-resolve@29.7.0: + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0) + jest-util: 29.7.0 + jest-validate: 29.7.0 + resolve: 1.22.11 + resolve.exports: 2.0.3 + slash: 3.0.0 + + jest-runner@29.7.0: + dependencies: + '@jest/console': 29.7.0 + '@jest/environment': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.11 + jest-docblock: 29.7.0 + jest-environment-node: 29.7.0 + jest-haste-map: 29.7.0 + jest-leak-detector: 29.7.0 + jest-message-util: 29.7.0 + jest-resolve: 29.7.0 + jest-runtime: 29.7.0 + jest-util: 29.7.0 + jest-watcher: 29.7.0 + jest-worker: 29.7.0 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + + jest-runtime@29.7.0: + dependencies: + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/globals': 29.7.0 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + chalk: 4.1.2 + cjs-module-lexer: 1.4.3 + collect-v8-coverage: 1.0.3 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + + jest-snapshot@29.7.0: + dependencies: + '@babel/core': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/types': 7.29.0 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.0) + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.7.4 + transitivePeerDependencies: + - supports-color + + jest-util@29.7.0: + dependencies: + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + chalk: 4.1.2 + ci-info: 3.9.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + + jest-validate@29.7.0: + dependencies: + '@jest/types': 29.6.3 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.6.3 + leven: 3.1.0 + pretty-format: 29.7.0 + + jest-watcher@29.7.0: + dependencies: + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 25.2.3 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.7.0 + string-length: 4.0.2 + jest-worker@27.5.1: dependencies: '@types/node': 25.2.3 merge-stream: 2.0.0 supports-color: 8.1.1 + jest-worker@29.7.0: + dependencies: + '@types/node': 25.2.3 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + + jest@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + js-tokens@4.0.0: {} + + js-yaml@3.14.2: + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + js-yaml@4.1.1: dependencies: argparse: 2.0.1 jsdoc-type-pratt-parser@7.1.1: {} + jsesc@3.1.0: {} + json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} @@ -2434,17 +4331,25 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} + json5@2.2.3: {} + keyv@4.5.4: dependencies: json-buffer: 3.0.1 kind-of@6.0.3: {} + kleur@3.0.3: {} + + leven@3.1.0: {} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 + lines-and-columns@1.2.4: {} + linkify-it@5.0.0: dependencies: uc.micro: 2.1.0 @@ -2478,6 +4383,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash.memoize@4.1.2: {} + lodash.merge@4.6.2: {} log-update@6.1.0: @@ -2490,8 +4397,22 @@ snapshots: lru-cache@11.2.6: {} + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + lunr@2.3.9: {} + make-dir@4.0.0: + dependencies: + semver: 7.7.4 + + make-error@1.3.6: {} + + makeerror@1.0.12: + dependencies: + tmpl: 1.0.5 + markdown-it@14.1.1: dependencies: argparse: 2.0.1 @@ -2520,6 +4441,8 @@ snapshots: dependencies: mime-db: 1.52.0 + mimic-fn@2.1.0: {} + mimic-function@5.0.1: {} minimatch@10.2.1: @@ -2534,6 +4457,8 @@ snapshots: dependencies: brace-expansion: 2.0.2 + minimist@1.2.8: {} + minipass@7.1.2: {} mj-context-menu@1.0.0: @@ -2550,6 +4475,8 @@ snapshots: neo-async@2.6.2: {} + node-int64@0.4.0: {} + node-releases@2.0.27: {} noms@0.0.0: @@ -2557,12 +4484,22 @@ snapshots: inherits: 2.0.4 readable-stream: 1.0.34 + normalize-path@3.0.0: {} + + npm-run-path@4.0.1: + dependencies: + path-key: 3.1.1 + object-deep-merge@2.0.0: {} once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@5.1.2: + dependencies: + mimic-fn: 2.1.0 + onetime@7.0.0: dependencies: mimic-function: 5.0.1 @@ -2604,6 +4541,13 @@ snapshots: dependencies: parse-statements: 1.0.11 + parse-json@5.2.0: + dependencies: + '@babel/code-frame': 7.29.0 + error-ex: 1.3.4 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + parse-statements@1.0.11: {} path-exists@4.0.0: {} @@ -2627,6 +4571,8 @@ snapshots: pidtree@0.6.0: {} + pirates@4.0.7: {} + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 @@ -2639,18 +4585,33 @@ snapshots: prettier@3.8.1: {} + pretty-format@29.7.0: + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.3.1 + process-nextick-args@2.0.1: {} + prompts@2.4.2: + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + proxy-from-env@1.1.0: {} punycode.js@2.3.1: {} punycode@2.3.1: {} + pure-rand@6.1.0: {} + randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 + react-is@18.3.1: {} + readable-stream@1.0.34: dependencies: core-util-is: 1.0.3 @@ -2686,6 +4647,8 @@ snapshots: resolve-from@5.0.0: {} + resolve.exports@2.0.3: {} + resolve@1.22.11: dependencies: is-core-module: 2.16.1 @@ -2721,6 +4684,8 @@ snapshots: ajv-formats: 2.1.1(ajv@8.18.0) ajv-keywords: 5.1.0(ajv@8.18.0) + semver@6.3.1: {} + semver@7.7.4: {} serialize-javascript@6.0.2: @@ -2737,13 +4702,24 @@ snapshots: shebang-regex@3.0.0: {} + signal-exit@3.0.7: {} + signal-exit@4.1.0: {} + sisteransi@1.0.5: {} + + slash@3.0.0: {} + slice-ansi@7.1.2: dependencies: ansi-styles: 6.2.3 is-fullwidth-code-point: 5.1.0 + source-map-support@0.5.13: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 @@ -2766,8 +4742,19 @@ snapshots: commander: 14.0.2 wicked-good-xpath: 1.3.0 + sprintf-js@1.0.3: {} + + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + string-argv@0.3.2: {} + string-length@4.0.2: + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -2799,6 +4786,10 @@ snapshots: dependencies: ansi-regex: 6.2.2 + strip-bom@4.0.0: {} + + strip-final-newline@2.0.0: {} + strip-json-comments@3.1.1: {} supports-color@7.2.0: @@ -2833,6 +4824,12 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 + test-exclude@6.0.0: + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + through2@2.0.5: dependencies: readable-stream: 2.3.8 @@ -2843,6 +4840,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tmpl@1.0.5: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -2856,10 +4855,54 @@ snapshots: dependencies: typescript: 5.9.3 + ts-jest@29.4.6(@babel/core@7.29.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.29.0))(jest-util@29.7.0)(jest@29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)))(typescript@5.9.3): + dependencies: + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + handlebars: 4.7.8 + jest: 29.7.0(@types/node@25.2.3)(ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3)) + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.7.4 + type-fest: 4.41.0 + typescript: 5.9.3 + yargs-parser: 21.1.1 + optionalDependencies: + '@babel/core': 7.29.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.29.0) + jest-util: 29.7.0 + + ts-node@10.9.2(@types/node@25.2.3)(typescript@5.9.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.12 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 25.2.3 + acorn: 8.15.0 + acorn-walk: 8.3.5 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.4 + make-error: 1.3.6 + typescript: 5.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 + type-detect@4.0.8: {} + + type-fest@0.21.3: {} + + type-fest@4.41.0: {} + typedoc@0.28.17(typescript@5.9.3): dependencies: '@gerrit0/mini-shiki': 3.22.0 @@ -2886,6 +4929,9 @@ snapshots: uc.micro@2.1.0: {} + uglify-js@3.19.3: + optional: true + undici-types@7.16.0: {} untildify@4.0.0: {} @@ -2902,6 +4948,18 @@ snapshots: util-deprecate@1.0.2: {} + v8-compile-cache-lib@3.0.1: {} + + v8-to-istanbul@9.3.0: + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 + + walker@1.0.8: + dependencies: + makeerror: 1.0.12 + watchpack@2.5.1: dependencies: glob-to-regexp: 0.4.1 @@ -2976,6 +5034,8 @@ snapshots: word-wrap@1.2.5: {} + wordwrap@1.0.0: {} + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -2990,6 +5050,11 @@ snapshots: wrappy@1.0.2: {} + write-file-atomic@4.0.2: + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + xslt3@2.7.0: dependencies: axios: 1.13.5 @@ -3001,10 +5066,14 @@ snapshots: y18n@5.0.8: {} + yallist@3.1.1: {} + yaml@2.8.2: {} yargs-parser@20.2.9: {} + yargs-parser@21.1.1: {} + yargs@16.2.0: dependencies: cliui: 7.0.4 @@ -3015,4 +5084,16 @@ snapshots: y18n: 5.0.8 yargs-parser: 20.2.9 + yargs@17.7.2: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + yn@3.1.1: {} + yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..3f7e54bfd --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'testsuite' diff --git a/testsuite/package.json b/testsuite/package.json index bb084b9c2..47557e07d 100644 --- a/testsuite/package.json +++ b/testsuite/package.json @@ -4,7 +4,11 @@ "description": "MathJax jest tests for v4", "type": "module", "scripts": { - "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings --localstorage-file ./lib/localstorage' pnpm jest" + "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings --localstorage-file ./lib/localstorage' pnpm jest", + "lint": "pnpm -w lint testsuite/tests; pnpm -w lint testsuite/src", + "lint:fix": "pnpm -w lint:fix testsuite/tests; pnpm -w lint:fix testsuite/src", + "format": "pnpm -w format testsuite/tests; pnpm -w format testsuite/src", + "format:fix": "pnpm -w format:fix testsuite/tests; pnpm -w format:fix testsuite/src" }, "imports": { "#js/*": "../mjs/*", diff --git a/testsuite/src/constants.js b/testsuite/src/constants.js index 0623df1bd..a280cdaa2 100644 --- a/testsuite/src/constants.js +++ b/testsuite/src/constants.js @@ -2,4 +2,3 @@ import * as os from 'os'; export const tmpJsonFile = os.tmpdir() + '/test.json'; export const ESC = '\u001B'; - diff --git a/testsuite/src/dirname.ts b/testsuite/src/dirname.ts index 40b2d0905..1b145c10a 100644 --- a/testsuite/src/dirname.ts +++ b/testsuite/src/dirname.ts @@ -1,6 +1,10 @@ -declare var __dirname: string; +declare let __dirname: string; +/** + * Set the directory name for testing purposes. + * + * @param {string} name The directory name. + */ export function setDirname(name: string) { __dirname = name; } - diff --git a/testsuite/src/setupTex.ts b/testsuite/src/setupTex.ts index 8f8b31252..6f65ce8b0 100644 --- a/testsuite/src/setupTex.ts +++ b/testsuite/src/setupTex.ts @@ -1,25 +1,29 @@ -import {TeX} from '#js/input/tex.js'; -import {AbstractParseMap, RegExpMap, CommandMap} from '#js/input/tex/TokenMap.js'; -import {ConfigurationHandler} from '#js/input/tex/Configuration.js'; -import {HandlerType, ConfigurationType} from '#js/input/tex/HandlerTypes.js'; -import {MapHandler} from '#js/input/tex/MapHandler.js'; -import {HTMLDocument} from '#js/handlers/html/HTMLDocument.js'; -import {RegisterHTMLHandler} from '#js/handlers/html.js'; -import {liteAdaptor} from '#js/adaptors/liteAdaptor.js'; -import {MathItem, STATE} from '#js/core/MathItem.js'; -import {SerializedMmlVisitor} from '#js/core/MmlTree/SerializedMmlVisitor.js'; -import {MmlNode} from '#js/core/MmlTree/MmlNode.js'; -import {mathjax} from '#js/mathjax.js'; -import {OptionList} from '#js/util/Options.js'; -import {tmpJsonFile} from '#src/constants.js'; +import { TeX } from '#js/input/tex.js'; +import { + AbstractParseMap, + RegExpMap, + CommandMap, +} from '#js/input/tex/TokenMap.js'; +import { ConfigurationHandler } from '#js/input/tex/Configuration.js'; +import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js'; +import { MapHandler } from '#js/input/tex/MapHandler.js'; +import { HTMLDocument } from '#js/handlers/html/HTMLDocument.js'; +import { RegisterHTMLHandler } from '#js/handlers/html.js'; +import { liteAdaptor } from '#js/adaptors/liteAdaptor.js'; +import { MathItem, STATE } from '#js/core/MathItem.js'; +import { SerializedMmlVisitor } from '#js/core/MmlTree/SerializedMmlVisitor.js'; +import { MmlNode } from '#js/core/MmlTree/MmlNode.js'; +import { mathjax } from '#js/mathjax.js'; +import { OptionList } from '#js/util/Options.js'; +import { tmpJsonFile } from '#src/constants.js'; import * as fs from 'fs'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import {init} from '#source/node-main/node-main.mjs'; -import {expect} from '@jest/globals'; +import { init } from '#source/node-main/node-main.mjs'; +import { expect } from '@jest/globals'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import {source} from '#source/source.js'; +import { source } from '#source/source.js'; declare const MathJax: any; type MATHITEM = MathItem; @@ -48,20 +52,23 @@ const handler = RegisterHTMLHandler(adaptor); * A vistor to convert MmlNodes to serialized MathML. */ const visitor = new SerializedMmlVisitor(); -export const toMathML = ((node: MmlNode) => visitor.visitTree(node)); +export const toMathML = (node: MmlNode) => visitor.visitTree(node); /*********************************************************************/ /** * Trap output produced while running code. - * @param method The console method to trap. - * @param code The code to run. - * @return The output sent to the given method. + * + * @param {string} method The console method to trap. + * @param {Function} code The code to run. + * @returns {string} The output sent to the given method. */ -export function trapOutput(method: string, code: () => void) { +export function trapOutput(method: string, code: () => void): string { const saved = (console as any)[method]; let message = ''; - (console as any)[method] = (...msg: any[]) => {message += (message ? '\n' : '') + msg.join(' ')}; + (console as any)[method] = (...msg: any[]) => { + message += (message ? '\n' : '') + msg.join(' '); + }; code(); (console as any)[method] = saved; return message; @@ -69,26 +76,34 @@ export function trapOutput(method: string, code: () => void) { /** * Trap errors produced while running code. - * @param code The code to run. - * @return The error message produced. + * + * @param {Function} code The code to run. + * @returns {string} The error message produced. */ -export function trapErrors(code: () => void) { +export function trapErrors(code: () => void): string { let message = '(no error)'; reportErrors = true; - try {code()} catch (e) {message = e.message} + try { + code(); + } catch (e) { + message = e.message; + } reportErrors = false; return message; } /** * Trap errors produced while running code. - * @param code The code to run. - * @return The error message produced. + * + * @param {Function} code The code to run. + * @returns {string} The error message produced. */ export async function trapAsyncErrors(code: () => Promise) { let message = '(no error)'; reportErrors = true; - await code().catch((e) => {message = e.message}); + await code().catch((e) => { + message = e.message; + }); reportErrors = false; return message; } @@ -106,8 +121,8 @@ export const throwTexErrors = { formatError(jax: any, err: Error) { if (reportErrors) throw err; return jax.formatError(err); - } -} + }, +}; /** * Configuration that causes compile errors to throw rather than @@ -118,34 +133,42 @@ export const throwCompileErrors = { compileError(jax: any, math: any, err: Error) { if (reportErrors) throw err; return jax.compileError(math, err); - } - } -} + }, + }, +}; /** * Trap TeX processing errors and return an expect() result - * @param string The TeX string to process - * @param display True for display style, false for in-line - * @param typeset The function used to typeset the TeX (tex2mml, typeset2mml, etc) + * + * @param {string} tex The TeX string to process + * @param {boolean} display True for display style, false for in-line + * @param {Function} fn The function used to typeset the TeX (tex2mml, typeset2mml, etc) + * @returns {any} The test output */ export function expectTexError( tex: string, display: boolean = true, - fn: (((tex: string, display?: boolean) => any) | ((tex: string) => any)) = tex2mml, + fn: + | ((tex: string, display?: boolean) => any) + | ((tex: string) => any) = tex2mml ): any { return expect(trapErrors(() => fn(tex, display))); } /** * Trap TeX processing errors and return an expect() result - * @param string The TeX string to process - * @param display True for display style, false for in-line - * @param typeset The function used to typeset the TeX (tex2mml, typeset2mml, etc) + * + * @param {string} tex The TeX string to process + * @param {boolean} display True for display style, false for in-line + * @param {Function} fn The function used to typeset the TeX (tex2mml, typeset2mml, etc) + * @returns {any} The test output */ export function expectTypesetError( tex: string, display: boolean = true, - fn: (((tex: string, display?: boolean) => Promise) | ((tex: string) => Promise)) = typeset2mml, + fn: + | ((tex: string, display?: boolean) => Promise) + | ((tex: string) => Promise) = typeset2mml ): any { return expect(trapAsyncErrors(() => fn(tex, display))).resolves; } @@ -159,12 +182,20 @@ export function expectTypesetError( * @param {string[]} packages The TeX packages to configure * @param {OptionList} options The TeX options to include */ -export function setupTex(packages: PackageList = ['base'], options: OptionList = {}) { - const parserOptions = Object.assign({}, {packages}, throwTexErrors, options); +export function setupTex( + packages: PackageList = ['base'], + options: OptionList = {} +) { + const parserOptions = Object.assign( + {}, + { packages }, + throwTexErrors, + options + ); const tex = new TeX(parserOptions); - const html = new HTMLDocument('', adaptor, {InputJax: tex}); + const html = new HTMLDocument('', adaptor, { InputJax: tex }); convert = (expr: string, display: boolean) => - toMathML(html.convert(expr, {display: display, end: STATE.CONVERT})); + toMathML(html.convert(expr, { display: display, end: STATE.CONVERT })); } /** @@ -174,10 +205,13 @@ export function setupTex(packages: PackageList = ['base'], options: OptionList = * @param {string[]} packages The TeX packages to configure * @param {OptionList} options The TeX options to include */ -export function setupTexRender(packages: PackageList = ['base'], options: OptionList = {}) { +export function setupTexRender( + packages: PackageList = ['base'], + options: OptionList = {} +) { const parserOptions = Object.assign( {}, - {packages: packages, inlineMath: {'[+]': [['$', '$']]}}, + { packages: packages, inlineMath: { '[+]': [['$', '$']] } }, throwTexErrors, options ); @@ -185,10 +219,10 @@ export function setupTexRender(packages: PackageList = ['base'], options: Option render = (text: string, display: boolean) => { const delim = display ? '$$' : '$'; const document = `${delim}${text}${delim}`; - const html = mathjax.document(document, {InputJax: tex}); + const html = mathjax.document(document, { InputJax: tex }); html.findMath().compile(); return toMathML((Array.from(html.math)[0] as MATHITEM).root); - } + }; } /** @@ -199,23 +233,25 @@ export function setupTexRender(packages: PackageList = ['base'], options: Option * @param {string[]} packages The TeX packages to configure * @param {OptionList} options The TeX options to include */ -export function setupTexTypeset(packages: PackageList = ['base'], options: OptionList = {}) { +export function setupTexTypeset( + packages: PackageList = ['base'], + options: OptionList = {} +) { MathJax.config.tex = Object.assign( {}, - {packages: packages, inlineMath: {'[+]': [['$', '$']]}}, + { packages: packages, inlineMath: { '[+]': [['$', '$']] } }, throwTexErrors, options ); typeset = async (text: string, display: boolean) => { await componentPromise; const delim = display ? '$$' : '$'; - MathJax.config.startup.document = - `${delim}${text}${delim}`; + MathJax.config.startup.document = `${delim}${text}${delim}`; MathJax.startup.getComponents(); const mathdoc = MathJax.startup.document; await mathjax.handleRetriesFor(() => mathdoc.findMath().compile()); return toMathML((Array.from(mathdoc.math) as MATHITEM[])[0].root); - } + }; } /** @@ -227,26 +263,28 @@ export function setupTexTypeset(packages: PackageList = ['base'], options: Optio * @param {string[]} packages The TeX packages to configure * @param {OptionList} options The TeX options to include */ -export function setupTexPage(packages: PackageList = ['base'], options: OptionList = {}) { +export function setupTexPage( + packages: PackageList = ['base'], + options: OptionList = {} +) { MathJax.config.tex = Object.assign( {}, - {packages: packages, inlineMath: {'[+]': [['$', '$']]}}, + { packages: packages, inlineMath: { '[+]': [['$', '$']] } }, throwTexErrors, options ); page = async (text: string) => { await componentPromise; - MathJax.config.startup.document = - `${text}`; + MathJax.config.startup.document = `${text}`; MathJax.startup.getComponents(); const mathdoc = MathJax.startup.document; await mathjax.handleRetriesFor(() => mathdoc.findMath().compile()); const math = Array.from(mathdoc.math) as MATHITEM[]; return math.map((mi) => toMathML(mi.root)); - } + }; } -import {SVG} from '#js/output/svg.js'; +import { SVG } from '#js/output/svg.js'; /** * Set up TeX input packages and options for tex2mml(), and create the convert() function, @@ -255,14 +293,20 @@ import {SVG} from '#js/output/svg.js'; * @param {string[]} packages The TeX packages to configure * @param {OptionList} options The TeX options to include */ -export function setupTexWithOutput(packages: string[] = ['base'], options: OptionList = {}) { - const parserOptions = Object.assign({}, {packages: packages}, options); +export function setupTexWithOutput( + packages: string[] = ['base'], + options: OptionList = {} +) { + const parserOptions = Object.assign({}, { packages: packages }, options); const tex = new TeX(parserOptions); - const html = new HTMLDocument('', adaptor, {InputJax: tex, OutputJax: new SVG()}); + const html = new HTMLDocument('', adaptor, { + InputJax: tex, + OutputJax: new SVG(), + }); const visitor = new SerializedMmlVisitor(); - const toMathML = ((node: MmlNode) => visitor.visitTree(node)); + const toMathML = (node: MmlNode) => visitor.visitTree(node); convert = (expr: string, display: boolean) => - toMathML(html.convert(expr, {display: display, end: STATE.CONVERT})); + toMathML(html.convert(expr, { display: display, end: STATE.CONVERT })); } /*********************************************************************/ @@ -276,7 +320,7 @@ export function setupTexWithOutput(packages: string[] = ['base'], options: Optio */ export function tex2mml(tex: string, display: boolean = true): string { return convert(tex, display); -}; +} /** * Convert TeX to MathML using MathDocument.findMath().compile() on a document @@ -298,7 +342,10 @@ export function render2mml(tex: string, display: boolean = true): string { * @param {boolean} display True for display math, false for in-line math * @returns {Promise} A promise for the MathML for the TeX expression */ -export function typeset2mml(tex: string, display: boolean = true): Promise { +export function typeset2mml( + tex: string, + display: boolean = true +): Promise { return typeset(tex, display); } @@ -320,7 +367,8 @@ export function page2mml(text: string): Promise { * Initialize the component framework (for typeset2mml() and * page2mml()), setting a promise for when that is complete (the * conversion functions with for that promise to resolve). - * @param config The MathJax configuration + * + * @param {any} config The MathJax configuration */ export async function setupComponents(config: any) { mathjax.handlers.unregister(handler); @@ -329,8 +377,10 @@ export async function setupComponents(config: any) { // so wrap it in a real promise, so Package will properly identify it. // MathJax.config.loader.require = (file: string) => { - return new Promise((ok, fail) => import(file).then(ok).catch(e => fail(e))); - } + return new Promise((ok, fail) => + import(file).then(ok).catch((e) => fail(e)) + ); + }; MathJax.config.loader.source = source; config.startup ??= {}; config.startup.typeset ??= false; @@ -346,6 +396,7 @@ const tokens: Map> = new Map(); /** * Adds a token to the token set. + * * @param {string} name Table name. * @param {string} token Token string. */ @@ -360,19 +411,22 @@ function addToken(name: string, token: string) { /** * Set difference. + * * @param {Set} exp Expected elements. * @param {Set} act Actual elements. - * @return {Set} Expected setminus actual. + * @returns {Set} Expected setminus actual. */ function setdifference(exp: Set, act: Set): Set { - act.forEach(x => exp.delete(x)); + act.forEach((x) => exp.delete(x)); return exp; } /** * Diff between macros - * @param {string} handler - * @return {[Set, number, number]} + * + * @param {string} handler The handler name. + * @returns {[Set, number, number]} Set of missing macros, expected + * size, actual size. */ function diffMacros(handler: string): [Set, number, number] { const expected = MapHandler.getMap(handler); @@ -389,10 +443,10 @@ function diffMacros(handler: string): [Set, number, number] { } interface tables { - table: string, - size: number, - actual: number, - missing: string[] + table: string; + size: number; + actual: number; + missing: string[]; } /** @@ -411,12 +465,13 @@ export function getTokens(configuration: string) { const allHandlers = [].concat( handlers[HandlerType.CHARACTER], handlers[HandlerType.MACRO], - handlers[HandlerType.ENVIRONMENT]); - let tables: tables[] = []; - let outJSON: { - configuration: string, - tables: tables[] - } = {configuration: configuration, tables: tables}; + handlers[HandlerType.ENVIRONMENT] + ); + const tables: tables[] = []; + const outJSON: { + configuration: string; + tables: tables[]; + } = { configuration: configuration, tables: tables }; allHandlers.forEach((handler) => { const [diff, exp, act] = diffMacros(handler); if (diff) { @@ -424,8 +479,8 @@ export function getTokens(configuration: string) { table: handler, size: exp, actual: act, - missing: Array.from(diff) - }) + missing: Array.from(diff), + }); } }); fs.appendFileSync(tmpJsonFile, ',' + JSON.stringify(outJSON, null, 2)); @@ -434,13 +489,15 @@ export function getTokens(configuration: string) { // // Force the original lookup to be called (so we get coverage for it) before we change it. // -(function () {new CommandMap('', {}).lookup('x')})(); +(function () { + new CommandMap('', {}).lookup('x'); +})(); // A prototype extension for the macro table lookups. -AbstractParseMap.prototype.lookup = function(token: string) { +AbstractParseMap.prototype.lookup = function (token: string) { const result = this.map.get(token); if (result) { addToken(this.name, token); } return result; -} +}; diff --git a/testsuite/src/texReporter.js b/testsuite/src/texReporter.js index 1fb0c0c83..0a27884b5 100644 --- a/testsuite/src/texReporter.js +++ b/testsuite/src/texReporter.js @@ -6,16 +6,13 @@ import { tmpJsonFile, ESC } from './constants.js'; import * as fs from 'fs'; export default class TexReporter { - constructor(globalConfig, reporterOptions, reporterContext) { this._globalConfig = globalConfig; this._options = reporterOptions; this._context = reporterContext; } - onRunStart( - aggregatedResults, options - ) { + onRunStart(aggregatedResults, options) { fs.writeFileSync(tmpJsonFile, '[{}'); } @@ -47,18 +44,27 @@ export default class TexReporter { */ function combineCoverage(coverage) { const maps = []; - coverage = coverage.sort((a, b) => a.configuration < b.configuration ? -1 : 1); + coverage = coverage.sort((a, b) => + a.configuration < b.configuration ? -1 : 1 + ); for (const configuration of coverage) { const rows = []; let actual = 0; let size = 0; - for (const table of configuration.tables.sort((a, b) => a.table < b.table ? -1 : 1)) { + for (const table of configuration.tables.sort((a, b) => + a.table < b.table ? -1 : 1 + )) { if (table.actual > table.size) { table.actual = table.size; } actual += table.actual; size += table.size; - rows.push([' ' + table.table, table.size, table.actual, table.missing.join(', ')]); + rows.push([ + ' ' + table.table, + table.size, + table.actual, + table.missing.join(', '), + ]); } maps.push([configuration.configuration, size, actual, ''], ...rows); } @@ -77,20 +83,25 @@ function createCoverageOutput(coverage) { const line = [ makeColumn('', width).replaceAll(' ', '-'), '--------|--------|------------|', - makeColumn('', mwidth).replaceAll(' ', '-').replace('|-', '') + makeColumn('', mwidth).replaceAll(' ', '-').replace('|-', ''), ].join(''); console.log(line); - console.log(makeColumn('Table', width, 0, true) + 'Entries | Tested | Percentage | Missing'); + console.log( + makeColumn('Table', width, 0, true) + + 'Entries | Tested | Percentage | Missing' + ); console.log(line); for (const [table, size, actual, missing] of rows) { const color = getColor(actual, size); - console.log([ - makeColumn(table, width, color, true), - makeColumn(size, 7, color), - makeColumn(actual, 6, color), - makeColumn(percentage(actual, size), 10, color), - colorize(missing, color) - ].join('')); + console.log( + [ + makeColumn(table, width, color, true), + makeColumn(size, 7, color), + makeColumn(actual, 6, color), + makeColumn(percentage(actual, size), 10, color), + colorize(missing, color), + ].join('') + ); } console.log(line); console.log(''); @@ -108,7 +119,8 @@ function trimMissing(rows, width) { for (const row of rows) { let missing = row[3]; if (missing.length > rest) { - row[3] = missing = '...' + missing.slice(missing.length - rest + 4).replace(/.*?, /, ''); + row[3] = missing = + '...' + missing.slice(missing.length - rest + 4).replace(/.*?, /, ''); } if (missing.length > mwidth) { mwidth = missing.length; @@ -144,7 +156,7 @@ function makeColumn(cell, size, color = 0, left = false) { * @return The percentage for table size to tested elements. */ function percentage(actual, size) { - return Math.round((actual/size) * 10000) / 100; + return Math.round((actual / size) * 10000) / 100; } /** @@ -154,7 +166,7 @@ function percentage(actual, size) { * @return The color number for use in a color escape sequence */ function getColor(actual, size) { - const percent = actual/size * 100; + const percent = (actual / size) * 100; return percent >= 80 ? 32 : percent >= 50 ? 33 : 31; } @@ -165,6 +177,7 @@ function getColor(actual, size) { * @return The cell contents with color sequences */ function colorize(cell, color) { - return color && process.stdout.isTTY ? `${ESC}[1m${ESC}[${color}m${cell}${ESC}[0m` : cell; + return color && process.stdout.isTTY + ? `${ESC}[1m${ESC}[${color}m${cell}${ESC}[0m` + : cell; } - diff --git a/testsuite/tests/input/tex/Action.test.ts b/testsuite/tests/input/tex/Action.test.ts index e2dbff448..1744ee09c 100644 --- a/testsuite/tests/input/tex/Action.test.ts +++ b/testsuite/tests/input/tex/Action.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'action'])); /**********************************************************************************/ describe('Action', () => { - it('TextTip', () => { expect(tex2mml('\\texttip{A}{B}')).toMatchSnapshot(); }); @@ -19,7 +18,6 @@ describe('Action', () => { it('Toggle', () => { expect(tex2mml('\\toggle A B C \\endtoggle')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Ams.test.ts b/testsuite/tests/input/tex/Ams.test.ts index a66b2a570..dce2117cb 100644 --- a/testsuite/tests/input/tex/Ams.test.ts +++ b/testsuite/tests/input/tex/Ams.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'ams'])); /**********************************************************************************/ describe('Ams', () => { - it('Symbol', () => { expect(tex2mml('\\digamma')).toMatchSnapshot(); }); @@ -167,75 +166,99 @@ describe('Ams', () => { it('Operatorname Followed by CS', () => { expect(tex2mml('\\operatorname{a+}\\alpha')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Ams Environments', () => { - it('Subarray', () => { expect(tex2mml('\\begin{subarray}{c}a\\end{subarray}')).toMatchSnapshot(); }); it('Small Matrix', () => { - expect(tex2mml('\\begin{smallmatrix}a\\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix}a\\end{smallmatrix}') + ).toMatchSnapshot(); }); it('Align', () => { - expect(tex2mml('\\begin{align} a&=b \\\\ c&=d \\end{align}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align} a&=b \\\\ c&=d \\end{align}') + ).toMatchSnapshot(); }); it('Align Star', () => { - expect(tex2mml('\\begin{align*} a&=b \\\\ c&=d \\end{align*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align*} a&=b \\\\ c&=d \\end{align*}') + ).toMatchSnapshot(); }); it('Multline', () => { - expect(tex2mml('\\begin{multline} a\\\\ b \\\\ c \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\ b \\\\ c \\end{multline}') + ).toMatchSnapshot(); }); it('Multline Star', () => { - expect(tex2mml('\\begin{multline*} a\\\\ b \\\\ c \\end{multline*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline*} a\\\\ b \\\\ c \\end{multline*}') + ).toMatchSnapshot(); }); it('Split', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{split} r&=s\\\\ & =t \\end{split} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Gather', () => { - expect(tex2mml('\\begin{gather} a=b \\\\ c=d \\end{gather}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{gather} a=b \\\\ c=d \\end{gather}') + ).toMatchSnapshot(); }); it('Gather Star', () => { - expect(tex2mml('\\begin{gather*} a=b \\\\ c=d \\end{gather*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{gather*} a=b \\\\ c=d \\end{gather*}') + ).toMatchSnapshot(); }); it('Alignat', () => { - expect(tex2mml('\\begin{alignat}{2} a&=b \\\\ c&=d \\end{alignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{alignat}{2} a&=b \\\\ c&=d \\end{alignat}') + ).toMatchSnapshot(); }); it('Alignat Star', () => { - expect(tex2mml('\\begin{alignat*}{2} a&=b \\\\ c&=d \\end{alignat*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{alignat*}{2} a&=b \\\\ c&=d \\end{alignat*}') + ).toMatchSnapshot(); }); it('Alignedat', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{alignedat}{2} r&=s\\\\ & =t \\end{alignedat} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Aligned', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{aligned} r&=s\\\\ & =t \\end{aligned} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Gathered', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{gathered} r=s\\\\ =t \\end{gathered} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Equation', () => { @@ -247,41 +270,57 @@ describe('Ams Environments', () => { }); it('Eqnarray', () => { - expect(tex2mml('\\begin{eqnarray} a & = & b\\\\ c & = & d \\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray} a & = & b\\\\ c & = & d \\end{eqnarray}') + ).toMatchSnapshot(); }); it('Eqnarray Star', () => { - expect(tex2mml('\\begin{eqnarray*} a & = & b\\\\ c & = & d \\end{eqnarray*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray*} a & = & b\\\\ c & = & d \\end{eqnarray*}') + ).toMatchSnapshot(); }); it('flalign', () => { - expect(tex2mml('\\begin{flalign} a & = & b\\\\ c & = & d \\end{flalign}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{flalign} a & = & b\\\\ c & = & d \\end{flalign}') + ).toMatchSnapshot(); }); it('xalignat', () => { - expect(tex2mml('\\begin{xalignat}{2} a&b & c&d \\end{xalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat}{2} a&b & c&d \\end{xalignat}') + ).toMatchSnapshot(); }); it('xalignat error', () => { - expectTexError('\\begin{xalignat}{x} \\and{xalignat}') - .toBe('Argument to \\begin{xalignat} must be a positive integer'); + expectTexError('\\begin{xalignat}{x} \\and{xalignat}').toBe( + 'Argument to \\begin{xalignat} must be a positive integer' + ); }); it('xxalignat', () => { - expect(tex2mml('\\begin{xxalignat}{2} a&b & c&d \\end{xxalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xxalignat}{2} a&b & c&d \\end{xxalignat}') + ).toMatchSnapshot(); }); it('xalignat error 2', () => { - expectTexError('\\begin{xalignat}{1} a&b & \\end{xalignat}') - .toBe('Extra & in row of xalignat'); + expectTexError('\\begin{xalignat}{1} a&b & \\end{xalignat}').toBe( + 'Extra & in row of xalignat' + ); }); it('xalignat padding', () => { - expect(tex2mml('\\begin{xalignat}{2} a&b \\end{xalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat}{2} a&b \\end{xalignat}') + ).toMatchSnapshot(); }); it('xalign tagged', () => { - expect(tex2mml('\\begin{xalignat}{2} a & b \\tag{1}\\end{xalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat}{2} a & b \\tag{1}\\end{xalignat}') + ).toMatchSnapshot(); }); it('flalign small', () => { @@ -289,29 +328,42 @@ describe('Ams Environments', () => { }); it('matrix', () => { - expect(tex2mml('\\begin{matrix} a & b \\\\ c & d \\end{matrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{matrix} a & b \\\\ c & d \\end{matrix}') + ).toMatchSnapshot(); }); it('pmatrix', () => { - expect(tex2mml('\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}') + ).toMatchSnapshot(); }); it('bmatrix', () => { - expect(tex2mml('\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}') + ).toMatchSnapshot(); }); it('Bmatrix', () => { - expect(tex2mml('\\begin{Bmatrix} a & b \\\\ c & d \\end{Bmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bmatrix} a & b \\\\ c & d \\end{Bmatrix}') + ).toMatchSnapshot(); }); it('Vmatrix', () => { - expect(tex2mml('\\begin{Vmatrix} a & b \\\\ c & d \\end{Vmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vmatrix} a & b \\\\ c & d \\end{Vmatrix}') + ).toMatchSnapshot(); }); it('cases', () => { - expect(tex2mml('f(x) = \\begin{cases} 1 & \\text{if $x > 1$} \\\\ 0 & \\text{otherwise} \\end{cases}')).toMatchSnapshot(); + expect( + tex2mml( + 'f(x) = \\begin{cases} 1 & \\text{if $x > 1$} \\\\ 0 & \\text{otherwise} \\end{cases}' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -324,63 +376,89 @@ describe('Ams Tagged Environments', () => { }); it('Small Matrix', () => { - expect(tex2mml('\\begin{smallmatrix}a\\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix}a\\end{smallmatrix}') + ).toMatchSnapshot(); }); it('Align', () => { - expect(tex2mml('\\begin{align} a&=b \\\\ c&=d \\end{align}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align} a&=b \\\\ c&=d \\end{align}') + ).toMatchSnapshot(); }); it('Align Star', () => { - expect(tex2mml('\\begin{align*} a&=b \\\\ c&=d \\end{align*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align*} a&=b \\\\ c&=d \\end{align*}') + ).toMatchSnapshot(); }); it('Multline', () => { - expect(tex2mml('\\begin{multline} a\\\\ b \\\\ c \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\ b \\\\ c \\end{multline}') + ).toMatchSnapshot(); }); it('Multline Star', () => { - expect(tex2mml('\\begin{multline*} a\\\\ b \\\\ c \\end{multline*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline*} a\\\\ b \\\\ c \\end{multline*}') + ).toMatchSnapshot(); }); it('Split', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{split} r&=s\\\\ & =t \\end{split} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Gather', () => { - expect(tex2mml('\\begin{gather} a=b \\\\ c=d \\end{gather}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{gather} a=b \\\\ c=d \\end{gather}') + ).toMatchSnapshot(); }); it('Gather Star', () => { - expect(tex2mml('\\begin{gather*} a=b \\\\ c=d \\end{gather*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{gather*} a=b \\\\ c=d \\end{gather*}') + ).toMatchSnapshot(); }); it('Alignat', () => { - expect(tex2mml('\\begin{alignat}{2} a&=b \\\\ c&=d \\end{alignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{alignat}{2} a&=b \\\\ c&=d \\end{alignat}') + ).toMatchSnapshot(); }); it('Alignat Star', () => { - expect(tex2mml('\\begin{alignat*}{2} a&=b \\\\ c&=d \\end{alignat*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{alignat*}{2} a&=b \\\\ c&=d \\end{alignat*}') + ).toMatchSnapshot(); }); it('Alignedat', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{alignedat}{2} r&=s\\\\ & =t \\end{alignedat} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Aligned', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{aligned} r&=s\\\\ & =t \\end{aligned} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Gathered', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align*} a&=b \\begin{gathered} r=s\\\\ =t \\end{gathered} \\\\ c&=d \\end{align*}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Equation', () => { @@ -392,23 +470,33 @@ describe('Ams Tagged Environments', () => { }); it('Eqnarray', () => { - expect(tex2mml('\\begin{eqnarray} a & = & b\\\\ c & = & d \\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray} a & = & b\\\\ c & = & d \\end{eqnarray}') + ).toMatchSnapshot(); }); it('Eqnarray Star', () => { - expect(tex2mml('\\begin{eqnarray*} a & = & b\\\\ c & = & d \\end{eqnarray*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray*} a & = & b\\\\ c & = & d \\end{eqnarray*}') + ).toMatchSnapshot(); }); it('Align Notag', () => { - expect(tex2mml('\\begin{align} a&=b \\\\ &=c \\notag \\end{align}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align} a&=b \\\\ &=c \\notag \\end{align}') + ).toMatchSnapshot(); }); it('xalignet', () => { - expect(tex2mml('\\begin{xalignat}{1} a&b \\end{xalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat}{1} a&b \\end{xalignat}') + ).toMatchSnapshot(); }); it('xalignet star', () => { - expect(tex2mml('\\begin{xalignat*}{1} a&b \\end{xalignat*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat*}{1} a&b \\end{xalignat*}') + ).toMatchSnapshot(); }); it('flalign', () => { @@ -416,17 +504,22 @@ describe('Ams Tagged Environments', () => { }); it('xalignet star', () => { - expect(tex2mml('\\begin{flalign*} a&b & \\end{flalign*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{flalign*} a&b & \\end{flalign*}') + ).toMatchSnapshot(); }); it('aligned [b]', () => { - expect(tex2mml('\\begin{aligned} [b] a \\\\ b \\end{aligned}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{aligned} [b] a \\\\ b \\end{aligned}') + ).toMatchSnapshot(); }); it('aligned [x]', () => { - expect(tex2mml('\\begin{aligned} [x] a \\\\ b \\end{aligned}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{aligned} [x] a \\\\ b \\end{aligned}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -435,92 +528,99 @@ describe('Ams Tagged Environments Left', () => { beforeEach(() => setupTex(['base', 'ams'], { tags: 'ams', tagSide: 'left' })); it('xalign tagged left', () => { - expect(tex2mml('\\begin{xalignat}{2} a & b \\tag{1}\\end{xalignat}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{xalignat}{2} a & b \\tag{1}\\end{xalignat}') + ).toMatchSnapshot(); }); it('multline tagged left', () => { - expect(tex2mml('\\begin{multline} a\\tag{1} \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\tag{1} \\end{multline}') + ).toMatchSnapshot(); }); it('Nesting error', () => { - expectTexError('\\begin{align}\\begin{align} \\end{align}\\end{align}') - .toBe('Erroneous nesting of equation structures') + expectTexError( + '\\begin{align}\\begin{align} \\end{align}\\end{align}' + ).toBe('Erroneous nesting of equation structures'); }); it('Gather Align', () => { - expect(tex2mml('\\begin{gather}\\begin{align} a &= b \\end{align}\\end{gather}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{gather}\\begin{align} a &= b \\end{align}\\end{gather}') + ).toMatchSnapshot(); }); it('Gather Gather', () => { - expectTexError('\\begin{gather}\\begin{gather} \\end{gather}\\end{gather}') - .toBe('Erroneous nesting of equation structures') + expectTexError( + '\\begin{gather}\\begin{gather} \\end{gather}\\end{gather}' + ).toBe('Erroneous nesting of equation structures'); }); - }); /**********************************************************************************/ describe('Amserror', () => { - it('Center Fraction Error', () => { - expectTexError('\\cfrac[c]{a}{b}') - .toBe('Illegal alignment specified in \\cfrac'); + expectTexError('\\cfrac[c]{a}{b}').toBe( + 'Illegal alignment specified in \\cfrac' + ); }); it('Genfrac Error', () => { - expectTexError('\\genfrac{[}{]}{0pt}{4}{a}{b}') - .toBe('Bad math style for \\genfrac'); + expectTexError('\\genfrac{[}{]}{0pt}{4}{a}{b}').toBe( + 'Bad math style for \\genfrac' + ); }); it('MissingOrUnrecognizedDelim', () => { - expectTexError('\\genfrac{(}{a}{}{2}{1}{2}') - .toBe('Missing or unrecognized delimiter for \\genfrac'); + expectTexError('\\genfrac{(}{a}{}{2}{1}{2}').toBe( + 'Missing or unrecognized delimiter for \\genfrac' + ); }); it('PositiveIntegerArg', () => { expectTexError( - '\\begin{align*} a&=b \\begin{alignedat}{-2} r&=s \\end{alignedat} \\\\ c&=d \\end{align*}' - ) - .toBe('Argument to \\begin{alignedat} must be a positive integer'); + '\\begin{align*} a&=b \\begin{alignedat}{-2} r&=s \\end{alignedat} \\\\ c&=d \\end{align*}' + ).toBe('Argument to \\begin{alignedat} must be a positive integer'); }); it('MultlineRowsOneCol', () => { - expectTexError('\\begin{multline}a\\\\b&c\\end{multline}') - .toBe('The rows within the multline environment must have exactly one column'); + expectTexError('\\begin{multline}a\\\\b&c\\end{multline}').toBe( + 'The rows within the multline environment must have exactly one column' + ); }); it('CommandNotAllowedInEnv', () => { - expectTexError('\\begin{split}a\\tag{1}\\end{split}') - .toBe('\\tag not allowed in split environment'); + expectTexError('\\begin{split}a\\tag{1}\\end{split}').toBe( + '\\tag not allowed in split environment' + ); }); it('MultipleCommand', () => { - expectTexError('a\\tag{1}\\tag{2}') - .toBe('Multiple \\tag'); + expectTexError('a\\tag{1}\\tag{2}').toBe('Multiple \\tag'); }); - }); /**********************************************************************************/ describe('InternalMath', () => { - it('Mbox Eqref', () => { expect(tex2mml('a\\mbox{ \\eqref{1} } c')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Multirel', () => { - it('Multirel Mathvariant 1', () => { expect(tex2mml('a <\\equiv \\mathrm{=>}\\thickapprox b')).toMatchSnapshot(); }); it('Multirel Mathvariant 2', () => { - expect(tex2mml('a <\\equiv \\mathrm{=>}\\thickapprox\\thicksim b')).toMatchSnapshot(); + expect( + tex2mml('a <\\equiv \\mathrm{=>}\\thickapprox\\thicksim b') + ).toMatchSnapshot(); }); it('Multirel Mathvariant 3', () => { @@ -528,9 +628,11 @@ describe('Multirel', () => { }); it('Multirel Mathvariant 4', () => { - expect(tex2mml( + expect( + tex2mml( 'a <\\equiv \\mathrm{=}\\mathrm{>}\\thickapprox\\thicksim\\frown\\smile=\\updownarrow b' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Preset Lspace Rspace', () => { @@ -540,109 +642,133 @@ describe('Multirel', () => { it('Preset Rspace Lspace', () => { expect(tex2mml('a\\gtrsim\\lesssim b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('MultlineShove', () => { - it('Shove None', () => { - expect(tex2mml('\\begin{multline} a\\\\ b\\\\ c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\ b\\\\ c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Left Top', () => { - expect(tex2mml('\\begin{multline}\\shoveleft a\\\\ b\\\\ c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline}\\shoveleft a\\\\ b\\\\ c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Left Middle', () => { - expect(tex2mml('\\begin{multline} a\\\\\\shoveleft b\\\\ c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\\\shoveleft b\\\\ c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Left Bottom', () => { - expect(tex2mml('\\begin{multline} a\\\\ b\\\\\\shoveleft c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\ b\\\\\\shoveleft c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Right Top', () => { - expect(tex2mml('\\begin{multline}\\shoveright a\\\\ b\\\\ c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline}\\shoveright a\\\\ b\\\\ c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Right Middle', () => { - expect(tex2mml('\\begin{multline} a\\\\\\shoveright b\\\\ c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\\\shoveright b\\\\ c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Right Bottom', () => { - expect(tex2mml('\\begin{multline} a\\\\ b\\\\\\shoveright c\\end{multline}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multline} a\\\\ b\\\\\\shoveright c\\end{multline}') + ).toMatchSnapshot(); }); it('Shove Right Left', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{multline} a\\\\\\shoveright\\shoveleft b\\\\ c\\end{multline}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Shove Left Right', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{multline} a\\\\\\shoveleft\\shoveright b\\\\ c\\end{multline}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Shove Error Top', () => { - expectTexError('\\begin{multline}a \\shoveleft\\\\ b\\\\ c\\end{multline}') - .toBe('\\shoveleft must come at the beginning of the line'); + expectTexError( + '\\begin{multline}a \\shoveleft\\\\ b\\\\ c\\end{multline}' + ).toBe('\\shoveleft must come at the beginning of the line'); }); it('Shove Error Middle', () => { - expectTexError('\\begin{multline} a\\\\ b \\shoveleft\\\\ c\\end{multline}') - .toBe('\\shoveleft must come at the beginning of the line'); + expectTexError( + '\\begin{multline} a\\\\ b \\shoveleft\\\\ c\\end{multline}' + ).toBe('\\shoveleft must come at the beginning of the line'); }); it('Shove Error Bottom', () => { - expectTexError('\\begin{multline} a\\\\ b\\\\ c \\shoveleft\\end{multline}') - .toBe('\\shoveleft must come at the beginning of the line'); + expectTexError( + '\\begin{multline} a\\\\ b\\\\ c \\shoveleft\\end{multline}' + ).toBe('\\shoveleft must come at the beginning of the line'); }); it('Shove Error Environment', () => { - expectTexError('\\begin{align}\\shoveleft a\\end{align}') - .toBe('\\shoveleft only allowed in multline environment'); + expectTexError('\\begin{align}\\shoveleft a\\end{align}').toBe( + '\\shoveleft only allowed in multline environment' + ); }); - }); /**********************************************************************************/ describe('Ams Complex', () => { - it('The Lorenz Equations', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align}\\dot{x} & = \\sigma(y-x) \\\\\\dot{y} & = \\rho x - y - xz \\\\\\dot{z} & = -\\beta z + xy\\end{align}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it("Maxwell's Equations", () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{align} \\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\ \\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\ \\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \\end{align}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Cubic Binomial', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{eqnarray}(x+y)^{3}&=&(x+y)(x+y)(x+y)\\\\&=&xxx+xxy+xyx+{\\underline {xyy}}+yxx+{\\underline {yxy}}+{\\underline {yyx}}+yyy\\\\&=&x^{3}+3x^{2}y+{\\underline {3xy^{2}}}+y^{3}.\\end{eqnarray}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('A Cross Product Formula', () => { - expect(tex2mml( + expect( + tex2mml( '\\mathbf{V}_1 \\times \\mathbf{V}_2 = \\begin{vmatrix} \\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\\\ \\frac{\\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\ \\frac{\\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0 \\\\ \\end{vmatrix}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Ams SideSet', () => { - it('Sideset Empty', () => { expect(tex2mml('\\sideset{}{}{}')).toMatchSnapshot(); }); @@ -652,19 +778,19 @@ describe('Ams SideSet', () => { }); it('Sideset Simple Right', () => { - expect(tex2mml('\\sideset{}{\'}{a}')).toMatchSnapshot(); + expect(tex2mml("\\sideset{}{'}{a}")).toMatchSnapshot(); }); it('Sideset Simple Left', () => { - expect(tex2mml('\\sideset{\'}{}{a}')).toMatchSnapshot(); + expect(tex2mml("\\sideset{'}{}{a}")).toMatchSnapshot(); }); it('Sideset Simple Left Right', () => { - expect(tex2mml('\\sideset{\'}{\'}{a}')).toMatchSnapshot(); + expect(tex2mml("\\sideset{'}{'}{a}")).toMatchSnapshot(); }); it('Sideset Simple Sum', () => { - expect(tex2mml('\\sideset{}{\'}\\sum_{n=0}^{k}n')).toMatchSnapshot(); + expect(tex2mml("\\sideset{}{'}\\sum_{n=0}^{k}n")).toMatchSnapshot(); }); it('Sideset Extra Post', () => { @@ -682,21 +808,23 @@ describe('Ams SideSet', () => { it('Sideset Pre with Post Sub', () => { expect(tex2mml('\\sideset{^a}{_b}{x}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Ams symbols', () => { - it('Delimiters', () => { - expect(tex2mml( + expect( + tex2mml( '\\left\\llcorner X \\right\\lrcorner \\left\\lvert X \\right\\rvert \\left\\lVert X \\right\\rVert' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Spaces', () => { - expect(tex2mml('\\nobreakspace\\negmedspace\\negthickspace')).toMatchSnapshot(); + expect( + tex2mml('\\nobreakspace\\negmedspace\\negthickspace') + ).toMatchSnapshot(); }); it('Accents', () => { @@ -704,7 +832,11 @@ describe('Ams symbols', () => { }); it('Limits', () => { - expect(tex2mml('\\injlim \\projlim \\varliminf \\varlimsup \\varinjlim \\varprojlim')).toMatchSnapshot(); + expect( + tex2mml( + '\\injlim \\projlim \\varliminf \\varlimsup \\varinjlim \\varprojlim' + ) + ).toMatchSnapshot(); }); it('boxed', () => { @@ -720,141 +852,188 @@ describe('Ams symbols', () => { }); it('math0mi 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\varkappa\\varGamma\\varDelta\\varTheta\\varLambda\\varXi\\varPi\\varSigma\\varUpsilon\\varPhi\\varPsi\\varOmega' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mi 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\beth\\gimel\\daleth\\backprime\\hslash\\varnothing\\blacktriangle\\triangledown\\blacktriangledown\\square\\Box' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mi 3', () => { - expect(tex2mml( + expect( + tex2mml( '\\blacksquare\\lozenge\\Diamond\\blacklozenge\\circledS\\bigstar\\sphericalangle\\measuredangle\\nexists\\complement' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mi 4', () => { - expect(tex2mml( + expect( + tex2mml( '\\mho\\eth\\Finv\\diagup\\Game\\diagdown\\Bbbk\\yen\\circledR\\checkmark\\maltese' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\ltimes\\smallsetminus\\rtimes\\Cap\\doublecap\\leftthreetimes\\Cup\\doublecup\\rightthreetimes\\barwedge\\curlywedge' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\veebar\\curlyvee\\doublebarwedge\\boxminus\\circleddash\\boxtimes\\circledast\\boxdot\\circledcirc\\boxplus' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 3', () => { - expect(tex2mml( + expect( + tex2mml( '\\centerdot\\divideontimes\\intercal\\leqq\\geqq\\leqslant\\geqslant\\eqslantless\\eqslantgtr\\lessapprox\\gtrapprox' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 4', () => { - expect(tex2mml( + expect( + tex2mml( '\\approxeq\\lessdot\\gtrdot\\lll\\llless\\ggg\\gggtr\\lessgtr\\gtrless\\lesseqgtr\\gtreqless\\lesseqqgtr\\gtreqqless' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 5', () => { - expect(tex2mml( + expect( + tex2mml( '\\doteqdot\\Doteq\\eqcirc\\risingdotseq\\circeq\\fallingdotseq\\triangleq\\backsim\\backsimeq\\subseteqq\\supseteqq' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 6', () => { - expect(tex2mml( + expect( + tex2mml( '\\Subset\\Supset\\sqsubset\\sqsupset\\preccurlyeq\\succcurlyeq\\curlyeqprec\\curlyeqsucc\\precsim\\succsim\\precapprox' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 7', () => { - expect(tex2mml( + expect( + tex2mml( '\\succapprox\\vartriangleleft\\lhd\\vartriangleright\\rhd\\trianglelefteq\\unlhd\\trianglerighteq\\unrhd\\vDash\\Vdash' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 8', () => { - expect(tex2mml( + expect( + tex2mml( '\\Vvdash\\smallsmile\\shortmid\\smallfrown\\shortparallel\\bumpeq\\between\\Bumpeq\\pitchfork\\varpropto\\backepsilon' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 9', () => { - expect(tex2mml( + expect( + tex2mml( '\\blacktriangleleft\\blacktriangleright\\therefore\\because\\eqsim\\vartriangle\\Join\\nless\\ngtr\\nleq\\ngeq' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 10', () => { - expect(tex2mml( + expect( + tex2mml( '\\nleqslant\\ngeqslant\\nleqq\\ngeqq\\lneq\\gneq\\lneqq\\gneqq\\lvertneqq\\gvertneqq\\lnsim\\gnsim\\lnapprox\\gnapprox' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 11', () => { - expect(tex2mml( + expect( + tex2mml( '\\nprec\\nsucc\\npreceq\\nsucceq\\precneqq\\succneqq\\precnsim\\succnsim\\precnapprox\\succnapprox\\nsim\\ncong' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 12', () => { - expect(tex2mml( + expect( + tex2mml( '\\nshortmid\\nshortparallel\\nmid\\nparallel\\nvdash\\nvDash\\nVdash\\nVDash\\ntriangleleft\\ntriangleright' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 13', () => { - expect(tex2mml( + expect( + tex2mml( '\\ntrianglelefteq\\ntrianglerighteq\\nsubseteq\\nsupseteq\\nsubseteqq\\nsupseteqq\\subsetneq\\supsetneq\\varsubsetneq' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 14', () => { - expect(tex2mml( + expect( + tex2mml( '\\varsupsetneq\\subsetneqq\\supsetneqq\\varsubsetneqq\\varsupsetneqq\\leftleftarrows\\rightrightarrows\\leftrightarrows' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 15', () => { - expect(tex2mml( + expect( + tex2mml( '\\rightleftarrows\\Lleftarrow\\Rrightarrow\\twoheadleftarrow\\twoheadrightarrow\\leftarrowtail\\rightarrowtail' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 16', () => { - expect(tex2mml( + expect( + tex2mml( '\\looparrowleft\\looparrowright\\leftrightharpoons\\rightleftharpoons\\curvearrowleft\\curvearrowright\\circlearrowleft' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 17', () => { - expect(tex2mml( + expect( + tex2mml( '\\circlearrowright\\Lsh\\Rsh\\upuparrows\\downdownarrows\\upharpoonleft\\upharpoonright\\downharpoonleft\\restriction' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 18', () => { - expect(tex2mml( + expect( + tex2mml( '\\multimap\\downharpoonright\\leftrightsquigarrow\\rightsquigarrow\\leadsto\\dashrightarrow\\dashleftarrow\\nleftarrow' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('math0mo 19', () => { - expect(tex2mml('\\nrightarrow\\nLeftarrow\\nRightarrow\\nleftrightarrow\\nLeftrightarrow')).toMatchSnapshot(); + expect( + tex2mml( + '\\nrightarrow\\nLeftarrow\\nRightarrow\\nleftrightarrow\\nLeftrightarrow' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Amscd.test.ts b/testsuite/tests/input/tex/Amscd.test.ts index 8c264b5e7..78218a9c5 100644 --- a/testsuite/tests/input/tex/Amscd.test.ts +++ b/testsuite/tests/input/tex/Amscd.test.ts @@ -7,53 +7,70 @@ beforeEach(() => setupTex(['base', 'amscd'])); /**********************************************************************************/ describe('AmsCD', () => { - it('AmsCD-1', () => { - expect(tex2mml('\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}') + ).toMatchSnapshot(); }); it('AmsCD-2', () => { - expect(tex2mml('\\begin{CD}A @<<< B @>>> C\\\\@. @| @AAA\\\\@. D @= E\\end{CD}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{CD}A @<<< B @>>> C\\\\@. @| @AAA\\\\@. D @= E\\end{CD}') + ).toMatchSnapshot(); }); it('AmsCD-3', () => { - expect(tex2mml('\\begin{CD}A @>a>b> B\\\\@VlVrV @AlArA\\\\C @a>b> B\\\\@VlVrV @AlArA\\\\C @ { - expect(tex2mml( + expect( + tex2mml( '\\begin{CD}A @>>> B@>\\text{very long label}>>C\\\\@VVV @VVV @VVV\\\\D @>>> E@>>> F\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('AmsCD-5', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{CD}A @>>> B @>{\\text{very long label}}>> C \\\\@VVV @VVV @VVV \\\\D @>>> E @>{\\phantom{\\text{very long label}}}>> F\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('AmsCD-6', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{CD}A @>>> B @>{\\text{very long label}}>> C \\\\@VVV @VVV @VVV \\\\D @>>> E @>{\\rlap{\\scriptstyle{\\ \\ \\ \\text{shorter}}}\\phantom{\\text{very long label}}}>> F\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('AmsCD-width', () => { - expect(tex2mml( + expect( + tex2mml( '\\minCDarrowwidth{5cm}\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('AmsCD-height', () => { - expect(tex2mml( + expect( + tex2mml( '\\minCDarrowheight{4cm}\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('AmsCD-both', () => { - expect(tex2mml( + expect( + tex2mml( '\\minCDarrowheight{4cm}\\minCDarrowwidth{5cm}\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Spaces', () => { @@ -67,19 +84,20 @@ describe('AmsCD', () => { it('Entry with prime (#3373)', () => { expect(tex2mml(`\\begin{CD}A' @>>> B\\end{CD}`)).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('AmsCD Options', () => { - - beforeEach(() => setupTex(['base', 'amscd'], { amscd: {hideHorizontalLabels: true } })); + beforeEach(() => + setupTex(['base', 'amscd'], { amscd: { hideHorizontalLabels: true } }) + ); it('Hide Horizontal Labels', () => { - expect(tex2mml('\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{CD}A @>a>> B\\\\@VVbV @VVcV\\\\C @>d>> D\\end{CD}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Autoload.test.ts b/testsuite/tests/input/tex/Autoload.test.ts index 8a78233a6..15f390dbc 100644 --- a/testsuite/tests/input/tex/Autoload.test.ts +++ b/testsuite/tests/input/tex/Autoload.test.ts @@ -1,20 +1,26 @@ import { afterAll, beforeEach, describe, expect, test } from '@jest/globals'; -import { getTokens, setupTexTypeset, typeset2mml, setupComponents } from '#helpers'; +import { + getTokens, + setupTexTypeset, + typeset2mml, + setupComponents, +} from '#helpers'; -setupComponents({loader: {load: ['input/tex-base', '[tex]/autoload']}}); +setupComponents({ loader: { load: ['input/tex-base', '[tex]/autoload'] } }); /**********************************************************************************/ beforeEach(() => setupTexTypeset(['base', 'autoload'])); describe('Autoload', () => { - test('Autoload package', async () => { expect(await typeset2mml('\\bbox[red]{x}')).toMatchSnapshot(); }); test('Autoload environment', async () => { - expect(await typeset2mml('\\begin{CD} a @>>> b\\end{CD}')).toMatchSnapshot(); + expect( + await typeset2mml('\\begin{CD} a @>>> b\\end{CD}') + ).toMatchSnapshot(); }); }); diff --git a/testsuite/tests/input/tex/Base-browser.test.ts b/testsuite/tests/input/tex/Base-browser.test.ts index 7acbb7733..612ba586b 100644 --- a/testsuite/tests/input/tex/Base-browser.test.ts +++ b/testsuite/tests/input/tex/Base-browser.test.ts @@ -6,20 +6,18 @@ const window = { document: { getElementsByTagName: () => [1], location: `${FILE}#xyz`, - } + }, }; (global as any).window = window; /**********************************************************************************/ describe('Base Window', () => { - test('Base Tag', async () => { - const { BaseConfiguration } = await import('#js/input/tex/base/BaseConfiguration.js'); + const { BaseConfiguration } = + await import('#js/input/tex/base/BaseConfiguration.js'); expect(BaseConfiguration.options.baseURL).toBe(FILE); }); - }); /**********************************************************************************/ - diff --git a/testsuite/tests/input/tex/Base.test.ts b/testsuite/tests/input/tex/Base.test.ts index 15236a223..6a0054a9d 100644 --- a/testsuite/tests/input/tex/Base.test.ts +++ b/testsuite/tests/input/tex/Base.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base'])); /**********************************************************************************/ describe('Identifiers', () => { - /********************************************************************************/ it('Identifier', () => { expect(tex2mml('x')).toMatchSnapshot(); @@ -28,13 +27,11 @@ describe('Identifiers', () => { it('Other Character Variant', () => { expect(tex2mml('\\mathbf{\u0391}\u0391\u3333')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Sub and Superscripts', () => { - it('Empty base', () => { expect(tex2mml('^2')).toMatchSnapshot(); }); @@ -78,19 +75,19 @@ describe('Sub and Superscripts', () => { it('Inline OP Sup', () => { expect(tex2mml('\\mathop{X}^2', false)).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Negations', () => { - it('Negation Simple', () => { expect(tex2mml('a \\not= b')).toMatchSnapshot(); }); it('Negation Complex', () => { - expect(tex2mml('a \\not= b \\not\\rightarrow c \\not\\leq d')).toMatchSnapshot(); + expect( + tex2mml('a \\not= b \\not\\rightarrow c \\not\\leq d') + ).toMatchSnapshot(); }); it('Negation Explicit', () => { @@ -104,13 +101,11 @@ describe('Negations', () => { it('Negation Left Paren', () => { expect(tex2mml('\\not\\left(\\right.')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Primes', () => { - it('Prime', () => { expect(tex2mml("x'")).toMatchSnapshot(); }); @@ -158,13 +153,11 @@ describe('Primes', () => { it('Prime on Prime', () => { expect(tex2mml("x^{'^{'}}")).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Digits', () => { - it('Integer', () => { expect(tex2mml('2')).toMatchSnapshot(); }); @@ -192,7 +185,6 @@ describe('Digits', () => { it('Integer Font', () => { expect(tex2mml('\\mathbf{2}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -227,13 +219,11 @@ describe('DigitsEuropean', () => { it('Decimal Point European', () => { expect(tex2mml(',')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Roots', () => { - it('Square Root', () => { expect(tex2mml('\\sqrt{x}')).toMatchSnapshot(); }); @@ -251,15 +241,15 @@ describe('Roots', () => { }); it('Tweaked Root', () => { - expect(tex2mml('\\sqrt[\\leftroot{-2}\\uproot{2}\\beta]{k}')).toMatchSnapshot(); + expect( + tex2mml('\\sqrt[\\leftroot{-2}\\uproot{2}\\beta]{k}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Error', () => { - it('merror node', () => { expect(tex2mml('&')).toMatchSnapshot(); }); @@ -277,8 +267,9 @@ describe('Error', () => { }); it('Undefined-Env', () => { - expectTexError('\\begin{nonsense} a \\end{nonsense}') - .toBe("Unknown environment 'nonsense'"); + expectTexError('\\begin{nonsense} a \\end{nonsense}').toBe( + "Unknown environment 'nonsense'" + ); }); it('Double-super-error', () => { @@ -298,7 +289,9 @@ describe('Error', () => { }); it('Double under error', () => { - expectTexError('\\sum_2_3').toBe('Double subscripts: use braces to clarify'); + expectTexError('\\sum_2_3').toBe( + 'Double subscripts: use braces to clarify' + ); }); it('Brace Superscript Error', () => { @@ -306,18 +299,21 @@ describe('Error', () => { }); it('Double Prime Error', () => { - expectTexError("x^\\prime'") - .toBe('Prime causes double exponent: use braces to clarify'); + expectTexError("x^\\prime'").toBe( + 'Prime causes double exponent: use braces to clarify' + ); }); it('Double Prime Error 2', () => { - expectTexError("\\sum\\limits^n'") - .toBe('Prime causes double exponent: use braces to clarify'); + expectTexError("\\sum\\limits^n'").toBe( + 'Prime causes double exponent: use braces to clarify' + ); }); it('Hash Error', () => { - expectTexError('#') - .toBe("You can't use 'macro parameter character #' in math mode"); + expectTexError('#').toBe( + "You can't use 'macro parameter character #' in math mode" + ); }); it('Missing Right', () => { @@ -333,18 +329,21 @@ describe('Error', () => { }); it('Misplaced Move Root', () => { - expectTexError('\\uproot{2}\\sqrt[3]{a}') - .toBe('\\uproot can appear only within a root'); + expectTexError('\\uproot{2}\\sqrt[3]{a}').toBe( + '\\uproot can appear only within a root' + ); }); it('Multiple Move Root', () => { - expectTexError('\\sqrt[\\uproot{-2}\\uproot{2}\\beta]{k}') - .toBe('Multiple use of \\uproot'); + expectTexError('\\sqrt[\\uproot{-2}\\uproot{2}\\beta]{k}').toBe( + 'Multiple use of \\uproot' + ); }); it('Incorrect Move Root', () => { - expectTexError('\\sqrt[\\uproot-2.5\\beta]{k}') - .toBe('The argument to \\uproot must be an integer'); + expectTexError('\\sqrt[\\uproot-2.5\\beta]{k}').toBe( + 'The argument to \\uproot must be an integer' + ); }); it('Double Over', () => { @@ -352,8 +351,9 @@ describe('Error', () => { }); it('MissingBeginExtraEnd', () => { - expectTexError('\\end{array}') - .toBe('Missing \\begin{array} or extra \\end{array}'); + expectTexError('\\end{array}').toBe( + 'Missing \\begin{array} or extra \\end{array}' + ); }); it('ExtraCloseMissingOpen', () => { @@ -393,7 +393,9 @@ describe('Error', () => { }); it('Dimension Error', () => { - expectTexError('a\\\\[abc] b').toBe('Bracket argument to \\\\ must be a dimension'); + expectTexError('a\\\\[abc] b').toBe( + 'Bracket argument to \\\\ must be a dimension' + ); }); it('MissingArgFor', () => { @@ -413,22 +415,27 @@ describe('Error', () => { }); it('MissingCloseBracket', () => { - expectTexError('\\sqrt[3{x}') - .toBe("Could not find closing ']' for argument to \\sqrt"); + expectTexError('\\sqrt[3{x}').toBe( + "Could not find closing ']' for argument to \\sqrt" + ); }); it('MissingOrUnrecognizedDelim1', () => { - expectTexError('\\left\\alpha b') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError('\\left\\alpha b').toBe( + 'Missing or unrecognized delimiter for \\left' + ); }); it('MissingOrUnrecognizedDelim2', () => { - expectTexError('\\left( b\\right') - .toBe('Missing or unrecognized delimiter for \\right'); + expectTexError('\\left( b\\right').toBe( + 'Missing or unrecognized delimiter for \\right' + ); }); it('MissingDimOrUnits', () => { - expectTexError('\\rule{}').toBe('Missing dimension or its units for \\rule'); + expectTexError('\\rule{}').toBe( + 'Missing dimension or its units for \\rule' + ); }); it('TokenNotFoundForCommand', () => { @@ -436,18 +443,21 @@ describe('Error', () => { }); it('ExtraCloseLooking2', () => { - expectTexError('\\root [3} \\of 5 ') - .toBe('Extra close brace while looking for \\of'); + expectTexError('\\root [3} \\of 5 ').toBe( + 'Extra close brace while looking for \\of' + ); }); it('ErroneousNestingEq', () => { - expectTexError('\\begin{equation}\\begin{eqnarray}\\end{eqnarray}\\end{equation}') - .toBe('Erroneous nesting of equation structures'); + expectTexError( + '\\begin{equation}\\begin{eqnarray}\\end{eqnarray}\\end{equation}' + ).toBe('Erroneous nesting of equation structures'); }); it('ExtraAlignTab', () => { - expectTexError('\\cases{b & l & k}') - .toBe('Extra alignment tab in \\cases text'); + expectTexError('\\cases{b & l & k}').toBe( + 'Extra alignment tab in \\cases text' + ); }); it('Misplaced hline', () => { @@ -459,13 +469,15 @@ describe('Error', () => { }); it('InvalidEnv', () => { - expectTexError('\\begin{\\ff}kk\\end{\\ff}') - .toBe('Invalid environment name \'\\ff\''); + expectTexError('\\begin{\\ff}kk\\end{\\ff}').toBe( + "Invalid environment name '\\ff'" + ); }); it('EnvBadEnd', () => { - expectTexError('\\begin{equation}a\\end{array}') - .toBe('\\begin{equation} ended with \\end{array}'); + expectTexError('\\begin{equation}a\\end{array}').toBe( + '\\begin{equation} ended with \\end{array}' + ); }); it('EnvMissingEnd Array', () => { @@ -483,25 +495,29 @@ describe('Error', () => { it('EnvMissingEnd Equation', () => { expectTexError('\\begin{equation}a').toBe('Missing \\end{equation}'); }); - }); /**********************************************************************************/ describe('Fenced', () => { - it('Fenced', () => { - expect(tex2mml('\\left(\\frac{a}{\\left[bc\\right]}\\right)')).toMatchSnapshot(); + expect( + tex2mml('\\left(\\frac{a}{\\left[bc\\right]}\\right)') + ).toMatchSnapshot(); }); it('Fenced2', () => { - expect(tex2mml('\\{\\frac{a}{\\uparrow bc\\downarrow}\\}')).toMatchSnapshot(); + expect( + tex2mml('\\{\\frac{a}{\\uparrow bc\\downarrow}\\}') + ).toMatchSnapshot(); }); it('Fenced3', () => { - expect(tex2mml( + expect( + tex2mml( '\\left\\{\\left\\vert \\left[ \\left\\| A \\right.\\right| \\right]\\right\\}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Middle', () => { @@ -521,13 +537,17 @@ describe('Fenced', () => { }); it('Fenced Arrows 5', () => { - expect(tex2mml( + expect( + tex2mml( '\\left\\{\\frac{a}{\\left\\uparrow bc\\right\\downarrow}\\right\\}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Fenced Arrows 1', () => { - expect(tex2mml('\\left\\uparrow \\frac{a}{b} \\right\\downarrow')).toMatchSnapshot(); + expect( + tex2mml('\\left\\uparrow \\frac{a}{b} \\right\\downarrow') + ).toMatchSnapshot(); }); it('Fenced Arrows 2', () => { @@ -535,17 +555,17 @@ describe('Fenced', () => { }); it('Fenced Arrows 3', () => { - expect(tex2mml( + expect( + tex2mml( '\\left\\uparrow \\frac{a}{b}\\middle\\downarrow c \\right\\uparrow' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathchoice', () => { - it('Modulo', () => { expect(tex2mml('a\\mod b')).toMatchSnapshot(); }); @@ -573,13 +593,11 @@ describe('Mathchoice', () => { it(`Bmod`, () => { expect(tex2mml('a \\bmod b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Stacking expressions', () => { - it('Frac', () => { expect(tex2mml('\\frac{a}{b}')).toMatchSnapshot(); }); @@ -613,7 +631,9 @@ describe('Stacking expressions', () => { }); it('Overunderset Accent', () => { - expect(tex2mml('\\overunderset{\\rightarrow}{\\leftarrow}{b}')).toMatchSnapshot(); + expect( + tex2mml('\\overunderset{\\rightarrow}{\\leftarrow}{b}') + ).toMatchSnapshot(); }); it('Over', () => { @@ -661,7 +681,9 @@ describe('Stacking expressions', () => { }); it('Over With Delims Sub3', () => { - expect(tex2mml('X_{1_{2_{3_{1 \\overwithdelims [ ] 2}}}}')).toMatchSnapshot(); + expect( + tex2mml('X_{1_{2_{3_{1 \\overwithdelims [ ] 2}}}}') + ).toMatchSnapshot(); }); it('Above With Delims', () => { @@ -677,11 +699,15 @@ describe('Stacking expressions', () => { }); it('Above With Delims Sub2', () => { - expect(tex2mml('X_{1_{2_{a \\abovewithdelims [ ] 1pt b}}}')).toMatchSnapshot(); + expect( + tex2mml('X_{1_{2_{a \\abovewithdelims [ ] 1pt b}}}') + ).toMatchSnapshot(); }); it('Above With Delims Sub3', () => { - expect(tex2mml('X_{1_{2_{3_{a \\abovewithdelims [ ] 1pt b}}}}')).toMatchSnapshot(); + expect( + tex2mml('X_{1_{2_{3_{a \\abovewithdelims [ ] 1pt b}}}}') + ).toMatchSnapshot(); }); it('Probability', () => { @@ -719,13 +745,11 @@ describe('Stacking expressions', () => { it('BuildRel Expression', () => { expect(tex2mml('x\\buildrel{a}\\over b y')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('MmlToken', () => { - it('MmlToken mo', () => { expect(tex2mml('\\mmlToken{mo}{rem}')).toMatchSnapshot(); }); @@ -739,11 +763,15 @@ describe('MmlToken', () => { }); it('MmlToken attribute boolean', () => { - expect(tex2mml('\\mmlToken{mo}[mathvariant=normal,largeop=true]{=}')).toMatchSnapshot(); + expect( + tex2mml('\\mmlToken{mo}[mathvariant=normal,largeop=true]{=}') + ).toMatchSnapshot(); }); it('MmlToken attribute boolean false', () => { - expect(tex2mml('\\mmlToken{mo}[mathvariant=normal,largeop=false]{=}')).toMatchSnapshot(); + expect( + tex2mml('\\mmlToken{mo}[mathvariant=normal,largeop=false]{=}') + ).toMatchSnapshot(); }); it('Token Illegal Type', () => { @@ -755,26 +783,27 @@ describe('MmlToken', () => { }); it('Token Invalid Attribute', () => { - expectTexError('\\mmlToken{mi}[m1=true]{}') - .toBe('Invalid MathML attribute: m1'); + expectTexError('\\mmlToken{mi}[m1=true]{}').toBe( + 'Invalid MathML attribute: m1' + ); }); it('Token Unknown Attribute', () => { - expectTexError('\\mmlToken{mo}[nothing="something"]{}') - .toBe('nothing is not a recognized attribute for mo'); + expectTexError('\\mmlToken{mo}[nothing="something"]{}').toBe( + 'nothing is not a recognized attribute for mo' + ); }); it('Token Wrong Attribute', () => { - expectTexError('\\mmlToken{mi}[movablelimit=true]{}') - .toBe('movablelimit is not a recognized attribute for mi'); + expectTexError('\\mmlToken{mi}[movablelimit=true]{}').toBe( + 'movablelimit is not a recognized attribute for mi' + ); }); - }); /**********************************************************************************/ describe('Matrix', () => { - it('Matrix Error', () => { expectTexError('\\matrix').toBe('Missing argument for \\matrix'); }); @@ -850,13 +879,11 @@ describe('Matrix', () => { it('Displaylines', () => { expect(tex2mml('\\displaylines{a\\\\ b}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('InternalMath', () => { - it('Interspersed Text', () => { expect(tex2mml('a\\text{c$d$e}b')).toMatchSnapshot(); }); @@ -866,8 +893,9 @@ describe('InternalMath', () => { }); it('Unicode text error', () => { - expectTexError('\\text{\\U{xyz}}') - .toBe('Argument to \\U must a hexadecimal number with 1 to 6 digits'); + expectTexError('\\text{\\U{xyz}}').toBe( + 'Argument to \\U must a hexadecimal number with 1 to 6 digits' + ); }); it('Mbox Mbox', () => { @@ -883,20 +911,19 @@ describe('InternalMath', () => { }); it('Internal Math Error', () => { - expectTexError('a\\mbox{$}} c') - .toBe('Math mode is not properly terminated'); + expectTexError('a\\mbox{$}} c').toBe( + 'Math mode is not properly terminated' + ); }); it('Mbox Internal Display', () => { expect(tex2mml('a\\mbox{aa \\(\\frac{a}{b}\\) bb} c')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Array', () => { - it('Array Single', () => { expect(tex2mml('\\begin{array}{c}a\\end{array}')).toMatchSnapshot(); }); @@ -918,19 +945,27 @@ describe('Array', () => { }); it('Enclosed bottom', () => { - expect(tex2mml('\\begin{array}{c} a\\\\\\hline\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c} a\\\\\\hline\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed top bottom', () => { - expect(tex2mml('\\begin{array}{c}\\hline a\\\\\\hline\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c}\\hline a\\\\\\hline\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed frame solid', () => { - expect(tex2mml('\\begin{array}{|c|}\\hline a\\\\\\hline\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c|}\\hline a\\\\\\hline\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed frame dashed', () => { - expect(tex2mml('\\begin{array}{:c:}\\hline a\\\\\\hline\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{:c:}\\hline a\\\\\\hline\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed solid dashed', () => { @@ -938,35 +973,51 @@ describe('Array', () => { }); it('Array dashed column', () => { - expect(tex2mml('\\begin{array}{c:c}a&c\\\\b&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c:c}a&c\\\\b&d\\end{array}') + ).toMatchSnapshot(); }); it('Array solid column', () => { - expect(tex2mml('\\begin{array}{c|c}a&c\\\\b&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c|c}a&c\\\\b&d\\end{array}') + ).toMatchSnapshot(); }); it('Array dashed row', () => { - expect(tex2mml('\\begin{array}{c}a\\\\\\hdashline b\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c}a\\\\\\hdashline b\\end{array}') + ).toMatchSnapshot(); }); it('Array solid row', () => { - expect(tex2mml('\\begin{array}{c}a\\\\\\hline b\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c}a\\\\\\hline b\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed dashed row', () => { - expect(tex2mml('\\begin{array}{|c|}a\\\\\\hdashline b\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c|}a\\\\\\hdashline b\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed solid row', () => { - expect(tex2mml('\\begin{array}{|c|}a\\\\\\hline b\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c|}a\\\\\\hline b\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed dashed column', () => { - expect(tex2mml('\\begin{array}{|c:c|}a&c\\\\b&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c:c|}a&c\\\\b&d\\end{array}') + ).toMatchSnapshot(); }); it('Enclosed solid column', () => { - expect(tex2mml('\\begin{array}{|c|c|}a&c\\\\b&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c|c|}a&c\\\\b&d\\end{array}') + ).toMatchSnapshot(); }); it('Array aligned', () => { @@ -986,67 +1037,85 @@ describe('Array', () => { }); it('Columnlines Solid None', () => { - expect(tex2mml('\\begin{array}{c|cc}a&b&c\\\\d&e&f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c|cc}a&b&c\\\\d&e&f\\end{array}') + ).toMatchSnapshot(); }); it('Rowlines Solid None', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{array}{ccc}a&b&c\\\\\\hline d&e&f\\\\ g&h&i \\end{array}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Column+Rowlines Solid None', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{array}{c|cc}a&b&c\\\\\\hline d&e&f\\\\ g&h&i \\end{array}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Column+Rowlines Solid Dashed None', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{array}{c|c:cc}0&a&b&c\\\\\\hline 1&d&e&f\\\\\\hdashline 2&g&h&i\\\\ 3&j&k&l \\end{array}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Matrix Test', () => { - expect(tex2mml( + expect( + tex2mml( '\\left( \\begin{array}{ccc}a & b & c \\\\d & e & f \\\\g & h & i \\end{array} \\right)' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newcolumntype', () => { - expect(tex2mml('\\newcolumntype{a}{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\newcolumntype{a}{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}') + ).toMatchSnapshot(); }); it('Newcolumntype Option', () => { - expect(tex2mml('\\newcolumntype{a}[1]{m{#1}}\\begin{array}{a{1em}|a{2em}}a&b\\\\c&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newcolumntype{a}[1]{m{#1}}\\begin{array}{a{1em}|a{2em}}a&b\\\\c&d\\end{array}' + ) + ).toMatchSnapshot(); }); it('Newcolumntype Error Argument', () => { - expectTexError('\\newcolumntype{ab}{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}') - .toBe('Column specifier must be exactly one character: ab'); + expectTexError( + '\\newcolumntype{ab}{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}' + ).toBe('Column specifier must be exactly one character: ab'); }); it('Newcolumntype Error Option', () => { - expectTexError('\\newcolumntype{a}[-1]{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}') - .toBe('Argument to -1 must be a positive integer'); + expectTexError( + '\\newcolumntype{a}[-1]{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}' + ).toBe('Argument to -1 must be a positive integer'); }); it('Newcolumntype Missing Option', () => { - expectTexError('\\newcolumntype{a}[1]{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}') - .toBe('Missing argument for a column declaration'); + expectTexError( + '\\newcolumntype{a}[1]{c}\\begin{array}{a|a}a&b\\\\c&d\\end{array}' + ).toBe('Missing argument for a column declaration'); }); it('Column Infinite Loop', () => { - expectTexError('\\newcolumntype{a}{a}\\begin{array}{a} x \\end{array}') - .toBe('Too many column specifiers (perhaps looping column definitions?)'); + expectTexError( + '\\newcolumntype{a}{a}\\begin{array}{a} x \\end{array}' + ).toBe('Too many column specifiers (perhaps looping column definitions?)'); }); - }); /**********************************************************************************/ describe('Moving limits', () => { - it('Limits SubSup', () => { expect(tex2mml('\\int^2\\limits_3')).toMatchSnapshot(); }); @@ -1130,13 +1199,11 @@ describe('Moving limits', () => { it('Underleftrightarrow', () => { expect(tex2mml('\\underleftrightarrow{abc}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Multirel', () => { - it('Shift Left', () => { expect(tex2mml('a< { }); it('Multirel Attributes 1', () => { - expect(tex2mml('a \\mmlToken{mo}[mathvariant=bold]{<}= b')).toMatchSnapshot(); + expect( + tex2mml('a \\mmlToken{mo}[mathvariant=bold]{<}= b') + ).toMatchSnapshot(); }); it('Multirel Attributes 2', () => { - expect(tex2mml('a \\mmlToken{mo}[mathvariant=bold]{<}\\mmlToken{mo}[mathsize=2]{=} b')).toMatchSnapshot(); + expect( + tex2mml( + 'a \\mmlToken{mo}[mathvariant=bold]{<}\\mmlToken{mo}[mathsize=2]{=} b' + ) + ).toMatchSnapshot(); }); it('Simple Shadow Rel', () => { @@ -1235,13 +1308,11 @@ describe('Multirel', () => { it('Infix Stretchy Right', () => { expect(tex2mml('a=\\rightarrow b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Other', () => { - it('Other', () => { expect(tex2mml('+')).toMatchSnapshot(); }); @@ -1305,13 +1376,11 @@ describe('Other', () => { it('CKJ', () => { expect(tex2mml('褯¥')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Base Complex', () => { - it('Square Root Complex', () => { expect(tex2mml('\\sqrt{3x-1}+(1+x)^2')).toMatchSnapshot(); }); @@ -1325,41 +1394,51 @@ describe('Base Complex', () => { }); it('Cauchy-Schwarz Inequality', () => { - expect(tex2mml( + expect( + tex2mml( '\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2} \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right)' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('An Identity of Ramanujan', () => { - expect(tex2mml( + expect( + tex2mml( '\\frac{1}{\\Bigl(\\sqrt{\\phi\\sqrt{5}}-\\phi\\Bigr) e^{\\frac25\\pi}} = 1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}} {1+\\frac{e^{-8\\pi}} {1+\\ldots} } } }' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('A Rogers-Ramanujan Identity', () => { - expect(tex2mml( + expect( + tex2mml( '1 + \\frac{q^2}{(1-q)} + \\frac{q^6}{(1-q)(1-q^2)} + \\cdots =\\prod_{j=0}^{\\infty} \\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \\quad\\quad \\text{for $|q|<1$}.' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('A Summation Formula', () => { - expect(tex2mml('\\sum_{n=1}^\\infty {1\\over n^2} = {\\pi^2\\over 6}')).toMatchSnapshot(); + expect( + tex2mml('\\sum_{n=1}^\\infty {1\\over n^2} = {\\pi^2\\over 6}') + ).toMatchSnapshot(); }); it('Cauchy Integral Formula', () => { - expect(tex2mml('f(a) = \\oint_\\gamma \\frac{f(z)}{z-a}dz')).toMatchSnapshot(); + expect( + tex2mml('f(a) = \\oint_\\gamma \\frac{f(z)}{z-a}dz') + ).toMatchSnapshot(); }); it('Standard Deviation', () => { - expect(tex2mml('\\sigma = \\sqrt{\\frac{1}{N}\\sum_{i=1}^N {(x_i-\\mu)}^2}')).toMatchSnapshot(); + expect( + tex2mml('\\sigma = \\sqrt{\\frac{1}{N}\\sum_{i=1}^N {(x_i-\\mu)}^2}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Environments', () => { - it('Eqnarray', () => { expect(tex2mml('\\begin{eqnarray}a&=&b\\end{eqnarray}')).toMatchSnapshot(); }); @@ -1369,7 +1448,9 @@ describe('Environments', () => { }); it('Displaymath', () => { - expect(tex2mml('\\begin{displaymath}a\\end{displaymath}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{displaymath}a\\end{displaymath}') + ).toMatchSnapshot(); }); it('math', () => { @@ -1389,7 +1470,9 @@ describe('Environments', () => { }); it('Array RCL Lines', () => { - expect(tex2mml('\\begin{array}{rcl}a&=&b\\\\c&=&d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{rcl}a&=&b\\\\c&=&d\\end{array}') + ).toMatchSnapshot(); }); it('Display Array Center', () => { @@ -1405,139 +1488,169 @@ describe('Environments', () => { }); it('Display Array RCL Lines', () => { - expect(tex2mml('\\begin{darray}{rcl}a&=&b\\\\c&=&d\\end{darray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{darray}{rcl}a&=&b\\\\c&=&d\\end{darray}') + ).toMatchSnapshot(); }); it('Nested array', () => { - expect(tex2mml('\\begin{array}{rcl}a&{}{b}&c\\begin{array}{cc}f&h\\\\g\\end{array}\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{rcl}a&{}{b}&c\\begin{array}{cc}f&h\\\\g\\end{array}\\end{array}' + ) + ).toMatchSnapshot(); }); it('IndentAlign', () => { - expect(tex2mml('\\begin{indentalign}[10cm][20cm][30cm]{lcr}a\\end{indentalign}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{indentalign}[10cm][20cm][30cm]{lcr}a\\end{indentalign}') + ).toMatchSnapshot(); }); it('IndentAlign Single', () => { - expect(tex2mml('\\begin{indentalign}[10cm][20cm][30cm]{c}a\\end{indentalign}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{indentalign}[10cm][20cm][30cm]{c}a\\end{indentalign}') + ).toMatchSnapshot(); }); it('IndentAlign First Only', () => { - expect(tex2mml('\\begin{indentalign}[10cm]{c}a\\end{indentalign}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{indentalign}[10cm]{c}a\\end{indentalign}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Environment Errors', () => { - it('IndentAlign BadAlignment', () => { - expectTexError('\\begin{indentalign}[10cm][20cm][30cm]{lkr}a\\end{indentalign}') - .toBe('Alignment must be one to three copies of l, c, or r'); + expectTexError( + '\\begin{indentalign}[10cm][20cm][30cm]{lkr}a\\end{indentalign}' + ).toBe('Alignment must be one to three copies of l, c, or r'); }); it('IndentAlign BadDimension', () => { - expectTexError('\\begin{indentalign}[10cm][20cm][30]{lcr}a\\end{indentalign}') - .toBe('Bracket argument to \\begin{indentalign} must be a dimension'); + expectTexError( + '\\begin{indentalign}[10cm][20cm][30]{lcr}a\\end{indentalign}' + ).toBe('Bracket argument to \\begin{indentalign} must be a dimension'); }); it('BreakAlign BadBreakAlign', () => { - expectTexError('\\begin{indentalign}[10cm][20cm][30]{lcr}a\\end{indentalign}') - .toBe('Bracket argument to \\begin{indentalign} must be a dimension'); + expectTexError( + '\\begin{indentalign}[10cm][20cm][30]{lcr}a\\end{indentalign}' + ).toBe('Bracket argument to \\begin{indentalign} must be a dimension'); }); it('Template loop', () => { - expectTexError('\\begin{array}{r@{a\\\\b}l}a&b\\\end{array}') - .toBe('Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?'); + expectTexError('\\begin{array}{r@{a\\\\b}l}a&b\\\end{array}').toBe( + 'Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?' + ); }); - }); /**********************************************************************************/ describe('BreakAlign', () => { - it('BreakAlign Case c', () => { - expect(tex2mml('\\begin{eqnarray}\\breakAlign{c}{t}a&=&b\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}\\breakAlign{c}{t}a&=&b\\end{eqnarray}') + ).toMatchSnapshot(); }); it('BreakAlign Case c second cell', () => { - expect(tex2mml('\\begin{eqnarray}a&\\breakAlign{c}{t}=&b\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}a&\\breakAlign{c}{t}=&b\\end{eqnarray}') + ).toMatchSnapshot(); }); it('BreakAlign Case r', () => { - expect(tex2mml('\\begin{eqnarray}\\breakAlign{r}{t}a&=&b\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}\\breakAlign{r}{t}a&=&b\\end{eqnarray}') + ).toMatchSnapshot(); }); it('BreakAlign Case r second row', () => { - expect(tex2mml('\\begin{eqnarray}\\breakAlign{r}{t}a&=&b\\\\\\breakAlign{r}{t}c&=&d\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{eqnarray}\\breakAlign{r}{t}a&=&b\\\\\\breakAlign{r}{t}c&=&d\\end{eqnarray}' + ) + ).toMatchSnapshot(); }); it('BreakAlign Case r multi split', () => { - expect(tex2mml('\\begin{eqnarray}\\breakAlign{r}{tbmc}a&=&b\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}\\breakAlign{r}{tbmc}a&=&b\\end{eqnarray}') + ).toMatchSnapshot(); }); it('BreakAlign Case t', () => { - expect(tex2mml('\\begin{eqnarray}\\breakAlign{t}{t}a&=&b\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}\\breakAlign{t}{t}a&=&b\\end{eqnarray}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('BreakAlign Errors', () => { - it('BreakAlign not in environment', () => { - expectTexError('\\breakAlign{c}{t}') - .toBe('\\breakAlign must be used in an alignment environment'); + expectTexError('\\breakAlign{c}{t}').toBe( + '\\breakAlign must be used in an alignment environment' + ); }); it('BreakAlign Case c', () => { - expectTexError('\\begin{eqnarray}a\\breakAlign{c}{t}&=&b\\end{eqnarray}') - .toBe('\\breakAlign{c} must be at the beginning of an alignment entry'); + expectTexError( + '\\begin{eqnarray}a\\breakAlign{c}{t}&=&b\\end{eqnarray}' + ).toBe('\\breakAlign{c} must be at the beginning of an alignment entry'); }); it('BreakAlign Case c split', () => { - expectTexError('\\begin{eqnarray}a\\breakAlign{c}{tb}&=&b\\end{eqnarray}') - .toBe('\\breakAlign{c} must be at the beginning of an alignment entry'); + expectTexError( + '\\begin{eqnarray}a\\breakAlign{c}{tb}&=&b\\end{eqnarray}' + ).toBe('\\breakAlign{c} must be at the beginning of an alignment entry'); }); it('BreakAlign Case r', () => { - expectTexError('\\begin{eqnarray}a&=&\\breakAlign{r}{t}b\\end{eqnarray}') - .toBe('\\breakAlign{r} must be at the beginning of an alignment row'); + expectTexError( + '\\begin{eqnarray}a&=&\\breakAlign{r}{t}b\\end{eqnarray}' + ).toBe('\\breakAlign{r} must be at the beginning of an alignment row'); }); it('BreakAlign Case t', () => { - expectTexError('\\begin{eqnarray}a&=&\\breakAlign{t}{t}b\\end{eqnarray}') - .toBe('\\breakAlign{t} must be at the beginning of an alignment'); + expectTexError( + '\\begin{eqnarray}a&=&\\breakAlign{t}{t}b\\end{eqnarray}' + ).toBe('\\breakAlign{t} must be at the beginning of an alignment'); }); it('BreakAlign Case t second row', () => { - expectTexError('\\begin{eqnarray}a&=&b\\\\\\breakAlign{t}{t}c&=&d\\end{eqnarray}') - .toBe('\\breakAlign{t} must be at the beginning of an alignment'); + expectTexError( + '\\begin{eqnarray}a&=&b\\\\\\breakAlign{t}{t}c&=&d\\end{eqnarray}' + ).toBe('\\breakAlign{t} must be at the beginning of an alignment'); }); it('BreakAlign Case t split', () => { - expectTexError('\\begin{eqnarray}\\breakAlign{c}{tb}a&=&b\\end{eqnarray}') - .toBe('Too many alignment characters: tb'); + expectTexError( + '\\begin{eqnarray}\\breakAlign{c}{tb}a&=&b\\end{eqnarray}' + ).toBe('Too many alignment characters: tb'); }); it('BreakAlign Case unknown', () => { - expectTexError('\\begin{eqnarray}\\breakAlign{a}{t}a&=&b\\end{eqnarray}') - .toBe('First argument to \\breakAlign must be one of c, r, or t'); + expectTexError( + '\\begin{eqnarray}\\breakAlign{a}{t}a&=&b\\end{eqnarray}' + ).toBe('First argument to \\breakAlign must be one of c, r, or t'); }); it('BreakAlign Case unknown split', () => { - expectTexError('\\begin{eqnarray}\\breakAlign{t}{a}a&=&b\\end{eqnarray}') - .toBe('Invalid alignment character: a'); + expectTexError( + '\\begin{eqnarray}\\breakAlign{t}{a}a&=&b\\end{eqnarray}' + ).toBe('Invalid alignment character: a'); }); - }); - /**********************************************************************************/ describe('Setting sizes', () => { - it('tiny', () => { expect(tex2mml('\\tiny a')).toMatchSnapshot(); }); @@ -1581,13 +1694,11 @@ describe('Setting sizes', () => { it('Empty', () => { expect(tex2mml('\\Huge')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Spaces', () => { - it('Positive Spacing', () => { expect(tex2mml('a\\quad b')).toMatchSnapshot(); }); @@ -1637,28 +1748,33 @@ describe('Spaces', () => { }); it('Hfil', () => { - expect(tex2mml('\\begin{array}{cc}a&\\hfil b\\\\d&ccc\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc}a&\\hfil b\\\\d&ccc\\end{array}') + ).toMatchSnapshot(); }); it('Hfill', () => { - expect(tex2mml('\\begin{array}{cc}a&\\hfill b\\\\d&ccc\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc}a&\\hfill b\\\\d&ccc\\end{array}') + ).toMatchSnapshot(); }); it('Hfilll', () => { - expect(tex2mml('\\begin{array}{cc}a&\\hfilll b\\\\d&ccc\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc}a&\\hfilll b\\\\d&ccc\\end{array}') + ).toMatchSnapshot(); }); it('Hfil Centering', () => { - expect(tex2mml('\\begin{array}{l} \\hfil x\\hfil \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{l} \\hfil x\\hfil \\end{array}') + ).toMatchSnapshot(); }); - }); - /**********************************************************************************/ describe('Delimiters', () => { - it('<', () => { expect(tex2mml('< a >')).toMatchSnapshot(); }); @@ -1680,8 +1796,9 @@ describe('Delimiters', () => { }); it('left right /', () => { - expectTexError('\\left/ a \\right\\\\') - .toBe('Missing or unrecognized delimiter for \\right'); + expectTexError('\\left/ a \\right\\\\').toBe( + 'Missing or unrecognized delimiter for \\right' + ); }); it('lmoustache', () => { @@ -1689,7 +1806,9 @@ describe('Delimiters', () => { }); it('left right lmoustache', () => { - expect(tex2mml('\\left\\lmoustache a \\right\\rmoustache')).toMatchSnapshot(); + expect( + tex2mml('\\left\\lmoustache a \\right\\rmoustache') + ).toMatchSnapshot(); }); it('lgroup', () => { @@ -1721,7 +1840,9 @@ describe('Delimiters', () => { }); it('left right updownarrow', () => { - expect(tex2mml('\\left\\updownarrow a \\right\\Updownarrow')).toMatchSnapshot(); + expect( + tex2mml('\\left\\updownarrow a \\right\\Updownarrow') + ).toMatchSnapshot(); }); it('backslash', () => { @@ -1779,13 +1900,11 @@ describe('Delimiters', () => { it('left right lbrack', () => { expect(tex2mml('\\left\\lbrack a \\right\\rbrack')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Named Functions', () => { - it('Limit', () => { expect(tex2mml('\\lim')).toMatchSnapshot(); }); @@ -1933,13 +2052,11 @@ describe('Named Functions', () => { it('tanh', () => { expect(tex2mml('\\tanh')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Greek characters', () => { - it('alpha', () => { expect(tex2mml('\\alpha')).toMatchSnapshot(); }); @@ -2067,13 +2184,11 @@ describe('Greek characters', () => { it('Psi', () => { expect(tex2mml('\\Psi')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathchar0mi', () => { - it('AA', () => { expect(tex2mml('\\AA')).toMatchSnapshot(); }); @@ -2185,13 +2300,11 @@ describe('Mathchar0mi', () => { it('spadesuit', () => { expect(tex2mml('\\spadesuit')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathchar0mo', () => { - it('Rightarrow', () => { expect(tex2mml('\\Rightarrow')).toMatchSnapshot(); }); @@ -2639,13 +2752,11 @@ describe('Mathchar0mo', () => { it('colon', () => { expect(tex2mml('\\colon')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Dots', () => { - it('Identifier Dots', () => { expect(tex2mml('A\\dots B')).toMatchSnapshot(); }); @@ -2713,14 +2824,11 @@ describe('Dots', () => { it('cdotp', () => { expect(tex2mml('\\cdotp')).toMatchSnapshot(); }); - }); - /**********************************************************************************/ describe('Font Simple', () => { - it('rm', () => { expect(tex2mml('\\rm a')).toMatchSnapshot(); }); @@ -2948,13 +3056,11 @@ describe('Font Simple', () => { it('texttt', () => { expect(tex2mml('\\texttt a')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Over Under Extenders', () => { - it('overparen', () => { expect(tex2mml('\\overparen{ab}')).toMatchSnapshot(); }); @@ -2982,13 +3088,11 @@ describe('Over Under Extenders', () => { it('overleftrightarrow', () => { expect(tex2mml('\\overleftrightarrow{ab}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Math style sizes', () => { - it('displaystyle', () => { expect(tex2mml('\\displaystyle A', false)).toMatchSnapshot(); }); @@ -3004,13 +3108,11 @@ describe('Math style sizes', () => { it('scriptscriptstyle', () => { expect(tex2mml('\\scriptscriptstyle a')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Special characters', () => { - it('Space', () => { expect(tex2mml('a b')).toMatchSnapshot(); }); @@ -3034,13 +3136,11 @@ describe('Special characters', () => { it('Prime', () => { expect(tex2mml('a\u2019b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Special macros', () => { - it('Iff', () => { expect(tex2mml('A \\iff B')).toMatchSnapshot(); }); @@ -3062,8 +3162,9 @@ describe('Special macros', () => { }); it('Pmb', () => { - expectTexError('a \\pmb a \\boldsymbol a') - .toBe('Undefined control sequence \\boldsymbol'); + expectTexError('a \\pmb a \\boldsymbol a').toBe( + 'Undefined control sequence \\boldsymbol' + ); }); it('Space', () => { @@ -3077,13 +3178,11 @@ describe('Special macros', () => { it('Space 3', () => { expect(tex2mml('A \\ B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Big Commands for Delimiters', () => { - it('big', () => { expect(tex2mml('\\big|')).toMatchSnapshot(); }); @@ -3127,13 +3226,11 @@ describe('Big Commands for Delimiters', () => { it('Big with braces', () => { expect(tex2mml('\\Big{\\{}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Boxes', () => { - it('Fbox', () => { expect(tex2mml('\\fbox{x}')).toMatchSnapshot(); }); @@ -3221,13 +3318,11 @@ describe('Boxes', () => { it('Rule 3D', () => { expect(tex2mml('\\Rule{2cm}{2cm}{1cm}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Moving Elements', () => { - it('Space 3D', () => { expect(tex2mml('\\Space{2cm}{2cm}{1cm}')).toMatchSnapshot(); }); @@ -3319,13 +3414,11 @@ describe('Moving Elements', () => { it('Mathstrut', () => { expect(tex2mml('\\mathstrut{x}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Linebreaks', () => { - it('Linebreak', () => { expect(tex2mml('a\\\\b')).toMatchSnapshot(); }); @@ -3409,13 +3502,11 @@ describe('Linebreaks', () => { it('goodbreak ord close', () => { expect(tex2mml('\u2220\\goodbreak )\\goodbreak')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('MathChar7', () => { - it('MathChar7 Single', () => { expect(tex2mml('\\#')).toMatchSnapshot(); }); @@ -3429,7 +3520,9 @@ describe('MathChar7', () => { }); it('MathChar7 Multi', () => { - expect(tex2mml('\\Lambda \\& \\Gamma \\Rightarrow \\Omega\\And\\Upsilon')).toMatchSnapshot(); + expect( + tex2mml('\\Lambda \\& \\Gamma \\Rightarrow \\Omega\\And\\Upsilon') + ).toMatchSnapshot(); }); it('Tilde', () => { @@ -3455,13 +3548,11 @@ describe('MathChar7', () => { it('Percentage', () => { expect(tex2mml('a\\%b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Accents', () => { - it('Vector', () => { expect(tex2mml('\\vec{a}')).toMatchSnapshot(); }); @@ -3525,13 +3616,11 @@ describe('Accents', () => { it('widehat', () => { expect(tex2mml('\\widehat{abc}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Character Class Changes', () => { - it('Mathop', () => { expect(tex2mml('\\mathop{\\rm a} b')).toMatchSnapshot(); }); @@ -3591,20 +3680,21 @@ describe('Character Class Changes', () => { it('mathinner', () => { expect(tex2mml('a\\mathinner{b}c')).toMatchSnapshot(); }); - }); - /**********************************************************************************/ describe('Spacing', () => { - it('Nonscript toplevel', () => { - expect(tex2mml('\\left. a \\nonscript\\;\\middle|\\nonscript\\; b \\right.')).toMatchSnapshot(); + expect( + tex2mml('\\left. a \\nonscript\\;\\middle|\\nonscript\\; b \\right.') + ).toMatchSnapshot(); }); it('Nonscript scriptlevel', () => { - expect(tex2mml('X_{\\left. a \\nonscript\\;\\middle|\\nonscript\\; b \\right.}')).toMatchSnapshot(); + expect( + tex2mml('X_{\\left. a \\nonscript\\;\\middle|\\nonscript\\; b \\right.}') + ).toMatchSnapshot(); }); it('hskip', () => { @@ -3626,14 +3716,11 @@ describe('Spacing', () => { it('mkern', () => { expect(tex2mml('\\mkern{1cm}')).toMatchSnapshot(); }); - }); - /**********************************************************************************/ describe('Complete Base Methods', () => { - it('Comment', () => { expect(tex2mml('a %comment')).toMatchSnapshot(); }); @@ -3641,7 +3728,6 @@ describe('Complete Base Methods', () => { it('Elided Times', () => { expect(tex2mml('a\\* b')).toMatchSnapshot(); }); - }); import { OverItem } from '#js/input/tex/base/BaseItems.js'; @@ -3649,20 +3735,16 @@ import { OverItem } from '#js/input/tex/base/BaseItems.js'; /**********************************************************************************/ describe('Complete Base Items', () => { - it('Over toString', () => { const over = new OverItem(null); expect(over.toString()).toBe('over[undefined / ]'); }); - }); /**********************************************************************************/ describe('Referencing', () => { - beforeEach(() => - setupTex(['base'], { tags: 'all' }) - ); + beforeEach(() => setupTex(['base'], { tags: 'all' })); it('Label', () => { expect(tex2mml('a\\label{A}')).toMatchSnapshot(); @@ -3673,17 +3755,19 @@ describe('Referencing', () => { }); it('Label Multiple', () => { - expect(tex2mml('\\begin{eqnarray}a\\label{A}\\\\c\\label{B}\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}a\\label{A}\\\\c\\label{B}\\end{eqnarray}') + ).toMatchSnapshot(); }); it('Label Multiple Error', () => { - expectTexError('a\\label{A}c\\label{B}') - .toBe('Multiple \\label'); + expectTexError('a\\label{A}c\\label{B}').toBe('Multiple \\label'); }); it('Label Multiply Defined Error', () => { - expectTexError('\\begin{eqnarray}a\\label{A}\\\\c\\label{A}\\end{eqnarray}') - .toBe("Label 'A' multiply defined"); + expectTexError( + '\\begin{eqnarray}a\\label{A}\\\\c\\label{A}\\end{eqnarray}' + ).toBe("Label 'A' multiply defined"); }); it('Ref', () => { @@ -3695,144 +3779,223 @@ describe('Referencing', () => { }); it('Nonumber', () => { - expect(tex2mml('\\begin{eqnarray}a\\\\c\\nonumber\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}a\\\\c\\nonumber\\end{eqnarray}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Complete Array', () => { - it('column r c l', () => { - expect(tex2mml('\\begin{array}{rcl}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{rcl}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c l | ', () => { - expect(tex2mml('\\begin{array}{r|c|l}a & b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r|c|l}a & b & c\\\\d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c l : ', () => { - expect(tex2mml('\\begin{array}{r:c:l}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r:c:l}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c l @ ', () => { - expect(tex2mml('\\begin{array}{r@{h}c@{h}l}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r@{h}c@{h}l}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c l ! ', () => { - expect(tex2mml('\\begin{array}{r!{h}c!{h}l}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r!{h}c!{h}l}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column p ', () => { - expect(tex2mml('\\begin{array}{p{1cm}p{1cm}p{1cm}}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{p{1cm}p{1cm}p{1cm}}a & b &c\\\\ d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); it('column m ', () => { - expect(tex2mml('\\begin{array}{m{1cm}m{1cm}m{1cm}}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{m{1cm}m{1cm}m{1cm}}a & b &c\\\\ d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); it('column b ', () => { - expect(tex2mml('\\begin{array}{b{1cm}b{1cm}b{1cm}}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{b{1cm}b{1cm}b{1cm}}a & b &c\\\\ d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); it('column r c l >', () => { - expect(tex2mml('\\begin{array}{>{A}rcl}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{>{A}rcl}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c l <', () => { - expect(tex2mml('\\begin{array}{r<{A}cl}a & b &c\\\\ d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r<{A}cl}a & b &c\\\\ d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column c >', () => { - expect(tex2mml('\\begin{array}{>{A}c}a \\\\ d\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{>{A}c}a \\\\ d\\end{array}') + ).toMatchSnapshot(); }); it('column c <', () => { - expect(tex2mml('\\begin{array}{c<{A}}a\\\\ d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c<{A}}a\\\\ d \\end{array}') + ).toMatchSnapshot(); }); it('column c @ end', () => { - expect(tex2mml('\\begin{array}{c@{h}}a\\\\ d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c@{h}}a\\\\ d \\end{array}') + ).toMatchSnapshot(); }); it('column c @&', () => { - expect(tex2mml('\\begin{array}{c@{\\alpha}c}a&\\hfill&b\\\\ d&\\hfill&e \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{c@{\\alpha}c}a&\\hfill&b\\\\ d&\\hfill&e \\end{array}' + ) + ).toMatchSnapshot(); }); it('column c w', () => { - expect(tex2mml('\\begin{array}{cw{c}{1cm}c}a&b&c\\\\ d&e&f \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cw{c}{1cm}c}a&b&c\\\\ d&e&f \\end{array}') + ).toMatchSnapshot(); }); it('column c W', () => { - expect(tex2mml('\\begin{array}{cW{c}{1cm}c}a&b&c\\\\ d&e&f \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cW{c}{1cm}c}a&b&c\\\\ d&e&f \\end{array}') + ).toMatchSnapshot(); }); it('column repeat r c ', () => { - expect(tex2mml('\\begin{array}{*{2}rc}a & b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{*{2}rc}a & b & c\\\\d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r repeat c ', () => { - expect(tex2mml('\\begin{array}{r*{2}c}a & b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r*{2}c}a & b & c\\\\d & e & f\\end{array}') + ).toMatchSnapshot(); }); it('column r c repeat | ', () => { - expect(tex2mml('\\begin{array}{r*{2}|c}a& b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{r*{2}|c}a& b & c\\\\d & e & f\\end{array}') + ).toMatchSnapshot(); }); - it('column r c repeat | {}', () => { - expect(tex2mml('\\begin{array}{r*{2}|c}a {\\hbox{(3)}}& b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{r*{2}|c}a {\\hbox{(3)}}& b & c\\\\d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); it('column r c repeat | {}', () => { - expect(tex2mml('\\begin{array}{r*{2}|c}a {\\begin{array}{c}Q\\end{array}}& b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{r*{2}|c}a {\\begin{array}{c}Q\\end{array}}& b & c\\\\d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); it('column r c repeat | {}', () => { - expect(tex2mml('\\begin{array}{r*{2}|c}a \\begin{array}{c}Q\\end{array}& b & c\\\\d & e & f\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{r*{2}|c}a \\begin{array}{c}Q\\end{array}& b & c\\\\d & e & f\\end{array}' + ) + ).toMatchSnapshot(); }); - it('column c @& hfil', () => { - expect(tex2mml('\\begin{array}{c@{\\alpha}c}a&&b\\\\ d&&e\\hfil \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{c@{\\alpha}c}a&&b\\\\ d&&e\\hfil \\end{array}') + ).toMatchSnapshot(); }); it('Label Error', () => { - expectTexError('\\eqalignno{a & & {\\hbox{(3)}}') - .toBe('Missing close brace'); + expectTexError('\\eqalignno{a & & {\\hbox{(3)}}').toBe( + 'Missing close brace' + ); }); it('end row spacing r c l', () => { - expect(tex2mml('\\begin{array}{rcl}a & b &c\\\\[2cm] d & e & f\\\\[2cm] \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{rcl}a & b &c\\\\[2cm] d & e & f\\\\[2cm] \\end{array}' + ) + ).toMatchSnapshot(); }); it('eqnarray extend last row', () => { - expect(tex2mml('\\begin{eqnarray}{rcl}a & b \\\\d&c&c&c \\\\\\end{eqnarray}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{eqnarray}{rcl}a & b \\\\d&c&c&c \\\\\\end{eqnarray}') + ).toMatchSnapshot(); }); it('end row hline c', () => { - expect(tex2mml('\\begin{array}{|c|}\\hline a\\\\\\hline b\\\\\\hline\\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{|c|}\\hline a\\\\\\hline b\\\\\\hline\\end{array}' + ) + ).toMatchSnapshot(); }); it('column ! | @', () => { - expect(tex2mml('\\begin{array}{!{a}|@{b}c} X\\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{!{a}|@{b}c} X\\end{array}') + ).toMatchSnapshot(); }); it('column @ | ! c', () => { - expect(tex2mml('\\begin{array}{@{}|!{x}c} X \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{@{}|!{x}c} X \\end{array}') + ).toMatchSnapshot(); }); it('column @ p m', () => { - expect(tex2mml('\\begin{array}{@{x}p{1em}m{1em}} X & Y \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{@{x}p{1em}m{1em}} X & Y \\end{array}') + ).toMatchSnapshot(); }); it('column c c @', () => { - expect(tex2mml('\\begin{array}{cc@{x}} X & Y \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc@{x}} X & Y \\end{array}') + ).toMatchSnapshot(); }); it('column c c | c', () => { - expect(tex2mml('\\begin{array}{cc|c} X & Y & Z \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc|c} X & Y & Z \\end{array}') + ).toMatchSnapshot(); }); it('column > space', () => { @@ -3848,25 +4011,30 @@ describe('Complete Array', () => { }); it('column buffer size', () => { - expectTexError('\\begin{array}{cW{c}{1cm}c}a&b}&c\\\\ d&e&f \\end{array}') - .toBe('MathJax internal buffer size exceeded; is there a recursive macro call?'); + expectTexError( + '\\begin{array}{cW{c}{1cm}c}a&b}&c\\\\ d&e&f \\end{array}' + ).toBe( + 'MathJax internal buffer size exceeded; is there a recursive macro call?' + ); }); it('Bad Dimension', () => { - expectTexError('\\begin{array}{cp{xyz}c}a&b&c\\end{array}') - .toBe('Missing dimension or its units for p column declaration'); + expectTexError('\\begin{array}{cp{xyz}c}a&b&c\\end{array}').toBe( + 'Missing dimension or its units for p column declaration' + ); }); it('Missing argument', () => { - expectTexError('\\begin{array}{c@}a&b\\end{array}') - .toBe('Missing argument for @ column declaration'); + expectTexError('\\begin{array}{c@}a&b\\end{array}').toBe( + 'Missing argument for @ column declaration' + ); }); it('Bad * argument', () => { - expectTexError('\\begin{array}{*{x}{x}} a&b \\end{array}') - .toBe('First argument to * column specifier must be a number'); + expectTexError('\\begin{array}{*{x}{x}} a&b \\end{array}').toBe( + 'First argument to * column specifier must be a number' + ); }); - }); /** @@ -3875,8 +4043,8 @@ describe('Complete Array', () => { * packages, that needed provisions in Base. * */ -import {Configuration} from '#js/input/tex/Configuration.js'; -import {HandlerType, ConfigurationType} from '#js/input/tex/HandlerTypes.js'; +import { Configuration } from '#js/input/tex/Configuration.js'; +import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js'; import { CommandMap, EnvironmentMap } from '#js/input/tex/TokenMap.js'; import BaseMethods from '#js/input/tex/base/BaseMethods.js'; import ParseMethods from '#js/input/tex/ParseMethods.js'; @@ -3885,7 +4053,6 @@ import TexParser from '#js/input/tex/TexParser.js'; /**********************************************************************************/ describe('User Defined Macros', () => { - new CommandMap('userMacros', { eqref: [BaseMethods.HandleRef, true], RR: [BaseMethods.Macro, '{\\bf R_{#1}}', 1, 'a'], @@ -3896,12 +4063,13 @@ describe('User Defined Macros', () => { .setProperties({ styles: { mathcolor: color } }); parser.stack.env['color'] = color; parser.Push(style); - } + }, }); Configuration.create('userMacros', { [ConfigurationType.HANDLER]: { [HandlerType.MACRO]: ['userMacros'], - }}); + }, + }); beforeEach(() => setupTex(['base', 'userMacros'])); @@ -3924,7 +4092,6 @@ describe('User Defined Macros', () => { it('Middle Color', () => { expect(tex2mml('\\left(A\\color{red}\\middle|B\\right)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -3934,7 +4101,6 @@ import { BeginEnvItem } from '#js/input/tex/newcommand/NewcommandItems.js'; import { MathtoolsMethods } from '#js/input/tex/mathtools/MathtoolsMethods.js'; describe('User Defined Environments', () => { - new EnvironmentMap('userEnvs', ParseMethods.environment, { smallmatrix: [ BaseMethods.Array, @@ -3971,21 +4137,29 @@ describe('User Defined Environments', () => { }, [ConfigurationType.ITEMS]: { [BeginEnvItem.prototype.kind]: BeginEnvItem, - } + }, }); beforeEach(() => setupTex(['base', 'userEnvs'])); it('smallmatrix', () => { - expect(tex2mml('\\begin{smallmatrix} a & b \\\\ c & d \\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix} a & b \\\\ c & d \\end{smallmatrix}') + ).toMatchSnapshot(); }); it('pmatrix', () => { - expect(tex2mml('\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}') + ).toMatchSnapshot(); }); it('Crampedsubarray', () => { - expect(tex2mml('\\begin{crampedsubarray}{cc} a & b \\\\ c & d \\end{crampedsubarray}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{crampedsubarray}{cc} a & b \\\\ c & d \\end{crampedsubarray}' + ) + ).toMatchSnapshot(); }); it('Gather', () => { @@ -3997,13 +4171,14 @@ describe('User Defined Environments', () => { }); it('Cases star', () => { - expect(tex2mml('\\begin{mmtool} a & test a\\\\ b & test b \\end{mmtool}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{mmtool} a & test a\\\\ b & test b \\end{mmtool}') + ).toMatchSnapshot(); }); it('EqnTest', () => { expect(tex2mml('\\begin{eqntest} a & b \\end{eqntest}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -4018,13 +4193,11 @@ describe('Tagged Environments', () => { it('Equation', () => { expect(tex2mml('\\begin{equation} x \\end{equation}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('MathStyle', () => { - it('French', () => { setupTex(['base', 'userEnvs'], { mathStyle: 'TeX' }); expect(tex2mml('Aa\\Gamma\\gamma')).toMatchSnapshot(); @@ -4050,31 +4223,27 @@ describe('MathStyle', () => { setupTex(['base', 'userEnvs'], { mathStyle: 'other' }); expect(tex2mml('Aa\\Gamma\\gamma')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Multiletter Indentifier', () => { - beforeEach(() => setupTex(['base', 'userEnvs'], { identifierPattern: /^$/ })); it('Mismatch', () => { expect(tex2mml('\\mathbf{aa}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Postfilter', () => { - Configuration.create('userFilters', { [ConfigurationType.POSTPROCESSORS]: [ - ({data}: {data: ParseOptions}) => { + ({ data }: { data: ParseOptions }) => { data.removeFromList('undefined', []); - } - ] + }, + ], }); beforeEach(() => setupTex(['base', 'userFilters'])); @@ -4082,10 +4251,8 @@ describe('Postfilter', () => { it('Empty list', () => { expect(tex2mml('x')).toMatchSnapshot(); }); - }); /**********************************************************************************/ afterAll(() => getTokens('base')); - diff --git a/testsuite/tests/input/tex/Bbm.test.ts b/testsuite/tests/input/tex/Bbm.test.ts index fb6e4226d..24490f6ee 100644 --- a/testsuite/tests/input/tex/Bbm.test.ts +++ b/testsuite/tests/input/tex/Bbm.test.ts @@ -5,7 +5,6 @@ import '#js/input/tex/bbm/BbmConfiguration'; /**********************************************************************************/ describe('Bbm', () => { - beforeEach(() => setupTex(['base', 'bbm'])); test('mathbbm', () => { @@ -21,24 +20,34 @@ describe('Bbm', () => { }); test('mathbbm mathversion', () => { - expect(tex2mml('\\mathversion{bold}\\mathbbm{Aa}\\mathversion{normal}\\mathbbm{Aa}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathversion{bold}\\mathbbm{Aa}\\mathversion{normal}\\mathbbm{Aa}' + ) + ).toMatchSnapshot(); }); test('mathbbmss mathversion', () => { - expect(tex2mml('\\mathversion{bold}\\mathbbmss{Aa}\\mathversion{normal}\\mathbbmss{Aa}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathversion{bold}\\mathbbmss{Aa}\\mathversion{normal}\\mathbbmss{Aa}' + ) + ).toMatchSnapshot(); }); test('mathbbmtt mathversion', () => { - expect(tex2mml('\\mathversion{bold}\\mathbbmtt{Aa}\\mathversion{normal}\\mathbbmtt{Aa}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathversion{bold}\\mathbbmtt{Aa}\\mathversion{normal}\\mathbbmtt{Aa}' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Bbm', () => { - - beforeEach(() => setupTex(['base', 'bbm'], {bbm: {bold: true}})); + beforeEach(() => setupTex(['base', 'bbm'], { bbm: { bold: true } })); test('mathbbm', () => { expect(tex2mml('\\mathbbm{Aa}')).toMatchSnapshot(); @@ -51,19 +60,19 @@ describe('Bbm', () => { test('mathbbmtt', () => { expect(tex2mml('\\mathbbmtt{Aa}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ declare const MathJax: any; -setupComponents({loader: {load: ['input/tex-base', 'output/chtml']}}); +setupComponents({ loader: { load: ['input/tex-base', 'output/chtml'] } }); describe('Bbm', () => { - - test('bbm with no output', async() => { - await expect(MathJax.loader.load('[tex]/bbm').then(() => true)).resolves.toBe(true); + test('bbm with no output', async () => { + await expect( + MathJax.loader.load('[tex]/bbm').then(() => true) + ).resolves.toBe(true); }); }); diff --git a/testsuite/tests/input/tex/Bboldx.test.ts b/testsuite/tests/input/tex/Bboldx.test.ts index 855f09614..b6593d0c3 100644 --- a/testsuite/tests/input/tex/Bboldx.test.ts +++ b/testsuite/tests/input/tex/Bboldx.test.ts @@ -6,7 +6,6 @@ import '#js/input/tex/textmacros/TextMacrosConfiguration'; /**********************************************************************************/ describe('Bboldx', () => { - beforeEach(() => setupTex(['base', 'bboldx'])); test('mathbb', () => { @@ -18,57 +17,77 @@ describe('Bboldx', () => { }); test('dotless', () => { - expect(tex2mml('\\imathbb\\jmathbb\\imathbfbb\\jmathbfbb')).toMatchSnapshot(); + expect( + tex2mml('\\imathbb\\jmathbb\\imathbfbb\\jmathbfbb') + ).toMatchSnapshot(); }); test('UC Greek', () => { - expect(tex2mml('\\bbGamma\\bbDelta\\bbTheta\\bbLambda\\bbXi\\bbPi\\bbSigma\\bbUpsilon\\bbPhi\\bbPsi\\bbOmega')).toMatchSnapshot(); + expect( + tex2mml( + '\\bbGamma\\bbDelta\\bbTheta\\bbLambda\\bbXi\\bbPi\\bbSigma\\bbUpsilon\\bbPhi\\bbPsi\\bbOmega' + ) + ).toMatchSnapshot(); }); test('LC Greek 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\bbalpha\\bbbeta\\bbgamma\\bbdelta\\bbepsilon\\bbzeta\\bbeta\\bbtheta\\bbiota\\bbkappa\\bblambda' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\bbmu\\bbnu\\bbxi\\bbpi\\bbrho\\bbsigma\\bbtau\\bbupsilon\\bbphi\\bbchi\\bbpsi\\bbomega' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('UC Greek Bf', () => { - expect(tex2mml( + expect( + tex2mml( '\\bfbbGamma\\bfbbDelta\\bfbbTheta\\bfbbLambda\\bfbbXi\\bfbbPi\\bfbbSigma\\bfbbUpsilon\\bfbbPhi\\bfbbPsi\\bfbbOmega' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek Bf 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\bfbbalpha\\bfbbbeta\\bfbbgamma\\bfbbdelta\\bfbbepsilon\\bfbbzeta\\bfbbeta\\bfbbtheta\\bfbbiota\\bfbbkappa\\bfbblambda' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek Bf 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\bfbbmu\\bfbbnu\\bfbbxi\\bfbbpi\\bfbbrho\\bfbbsigma\\bfbbtau\\bfbbupsilon\\bfbbphi\\bfbbchi\\bfbbpsi\\bfbbomega' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('Delimiters', () => { - expect(tex2mml('\\bbLparen\\bbRparen\\bbLbrack\\bbRbrack\\bbLangle\\bbRangle')).toMatchSnapshot(); + expect( + tex2mml('\\bbLparen\\bbRparen\\bbLbrack\\bbRbrack\\bbLangle\\bbRangle') + ).toMatchSnapshot(); }); test('Delimiters Bf', () => { - expect(tex2mml('\\bfbbLparen\\bfbbRparen\\bfbbLbrack\\bfbbRbrack\\bfbbLangle\\bfbbRangle')).toMatchSnapshot(); + expect( + tex2mml( + '\\bfbbLparen\\bfbbRparen\\bfbbLbrack\\bfbbRbrack\\bfbbLangle\\bfbbRangle' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Bboldx Text', () => { - beforeEach(() => setupTex(['base', 'bboldx', 'textmacros'])); test('textbb', () => { @@ -80,60 +99,82 @@ describe('Bboldx Text', () => { }); test('dotless', () => { - expect(tex2mml('\\text{\\itextbb\\jtextbb\\itextbfbb\\jtextbfbb}')).toMatchSnapshot(); + expect( + tex2mml('\\text{\\itextbb\\jtextbb\\itextbfbb\\jtextbfbb}') + ).toMatchSnapshot(); }); test('UC Greek', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbbGamma\\txtbbDelta\\txtbbTheta\\txtbbLambda\\txtbbXi\\txtbbPi\\txtbbSigma\\txtbbUpsilon\\txtbbPhi\\txtbbPsi\\txtbbOmega}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbbalpha\\txtbbbeta\\txtbbgamma\\txtbbdelta\\txtbbepsilon\\txtbbzeta\\txtbbeta\\txtbbtheta\\txtbbiota\\txtbbkappa\\txtbblambda}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbbmu\\txtbbnu\\txtbbxi\\txtbbpi\\txtbbrho\\txtbbsigma\\txtbbtau\\txtbbupsilon\\txtbbphi\\txtbbchi\\txtbbpsi\\txtbbomega}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('UC Greek Bf', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbfbbGamma\\txtbfbbDelta\\txtbfbbTheta\\txtbfbbLambda\\txtbfbbXi\\txtbfbbPi\\txtbfbbSigma\\txtbfbbUpsilon\\txtbfbbPhi\\txtbfbbPsi\\txtbfbbOmega}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek Bf 1', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbfbbalpha\\txtbfbbbeta\\txtbfbbgamma\\txtbfbbdelta\\txtbfbbepsilon\\txtbfbbzeta\\txtbfbbeta\\txtbfbbtheta\\txtbfbbiota\\txtbfbbkappa\\txtbfbblambda}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('LC Greek Bf 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\text{\\txtbfbbmu\\txtbfbbnu\\txtbfbbxi\\txtbfbbpi\\txtbfbbrho\\txtbfbbsigma\\txtbfbbtau\\txtbfbbupsilon\\txtbfbbphi\\txtbfbbchi\\txtbfbbpsi\\txtbfbbomega}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('Delimiters', () => { - expect(tex2mml('\\text{\\txtbbLparen\\txtbbRparen\\txtbbLbrack\\txtbbRbrack\\txtbbLangle\\txtbbRangle}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\txtbbLparen\\txtbbRparen\\txtbbLbrack\\txtbbRbrack\\txtbbLangle\\txtbbRangle}' + ) + ).toMatchSnapshot(); }); test('Delimiters Bf', () => { - expect(tex2mml('\\text{\\txtbfbbLparen\\txtbfbbRparen\\txtbfbbLbrack\\txtbfbbRbrack\\txtbfbbLangle\\txtbfbbRangle}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\txtbfbbLparen\\txtbfbbRparen\\txtbfbbLbrack\\txtbfbbRbrack\\txtbfbbLangle\\txtbfbbRangle}' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Bboldx light', () => { - - beforeEach(() => setupTex(['base', 'bboldx', 'textmacros'], {bboldx: {light: true}})); + beforeEach(() => + setupTex(['base', 'bboldx', 'textmacros'], { bboldx: { light: true } }) + ); test('mathbb', () => { expect(tex2mml('\\mathbb{Aa\u{393}\u{3B3}}')).toMatchSnapshot(); @@ -144,16 +185,18 @@ describe('Bboldx light', () => { }); test('Some Greek', () => { - expect(tex2mml('\\bbGamma\\bbgamma\\bfbbGamma\\bfbbgamma')).toMatchSnapshot(); + expect( + tex2mml('\\bbGamma\\bbgamma\\bfbbGamma\\bfbbgamma') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Bboldx bfbb', () => { - - beforeEach(() => setupTex(['base', 'bboldx', 'textmacros'], {bboldx: {bfbb: true}})); + beforeEach(() => + setupTex(['base', 'bboldx', 'textmacros'], { bboldx: { bfbb: true } }) + ); test('mathbb', () => { expect(tex2mml('\\mathbb{Aa\u{393}\u{3B3}}')).toMatchSnapshot(); @@ -164,11 +207,15 @@ describe('Bboldx bfbb', () => { }); test('Some Greek', () => { - expect(tex2mml('\\bbGamma\\bbgamma\\bfbbGamma\\bfbbgamma')).toMatchSnapshot(); + expect( + tex2mml('\\bbGamma\\bbgamma\\bfbbGamma\\bfbbgamma') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ -afterAll(() => {getTokens('bboldx'); getTokens('text-bboldx')}); +afterAll(() => { + getTokens('bboldx'); + getTokens('text-bboldx'); +}); diff --git a/testsuite/tests/input/tex/Bbox.test.ts b/testsuite/tests/input/tex/Bbox.test.ts index 85c22ddd0..90f8d072b 100644 --- a/testsuite/tests/input/tex/Bbox.test.ts +++ b/testsuite/tests/input/tex/Bbox.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'bbox'])); /**********************************************************************************/ describe('Bbox', () => { - it('Bbox-Background', () => { expect(tex2mml('\\bbox[yellow]{a}')).toMatchSnapshot(); }); @@ -29,29 +28,34 @@ describe('Bbox', () => { }); it('Bbox-Background-Padding-Frame', () => { - expect(tex2mml('\\bbox[yellow,5px,border:2px solid red]{a}')).toMatchSnapshot(); + expect( + tex2mml('\\bbox[yellow,5px,border:2px solid red]{a}') + ).toMatchSnapshot(); }); it('Bbox-Background-Error', () => { - expectTexError('\\bbox[yellow,green]{a}') - .toBe('Background specified twice in \\bbox'); + expectTexError('\\bbox[yellow,green]{a}').toBe( + 'Background specified twice in \\bbox' + ); }); it('Bbox-Padding-Error', () => { - expectTexError('\\bbox[5px,6px]{a}') - .toBe('Padding specified twice in \\bbox'); + expectTexError('\\bbox[5px,6px]{a}').toBe( + 'Padding specified twice in \\bbox' + ); }); it('Bbox-Frame-Error', () => { - expectTexError('\\bbox[border:2px solid red,border:2px solid green]{a}') - .toBe('Style specified twice in \\bbox'); + expectTexError( + '\\bbox[border:2px solid red,border:2px solid green]{a}' + ).toBe('Style specified twice in \\bbox'); }); it('Bbox-General-Error', () => { - expectTexError('\\bbox[22-11=color]{a}') - .toBe(`"22-11=color" doesn't look like a color, a padding dimension, or a style`); + expectTexError('\\bbox[22-11=color]{a}').toBe( + `"22-11=color" doesn't look like a color, a padding dimension, or a style` + ); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Begingroup.test.ts b/testsuite/tests/input/tex/Begingroup.test.ts index 613ea4d2c..01bebbbf7 100644 --- a/testsuite/tests/input/tex/Begingroup.test.ts +++ b/testsuite/tests/input/tex/Begingroup.test.ts @@ -3,10 +3,10 @@ import { getTokens, setupTex, tex2mml, expectTexError } from '#helpers'; import '#js/input/tex/begingroup/BegingroupConfiguration'; import '#js/input/tex/newcommand/NewcommandConfiguration'; -import { Configuration } from "#js/input/tex/Configuration.js"; -import { CommandMap } from "#js/input/tex/TokenMap.js"; -import TexParser from "#js/input/tex/TexParser.js"; -import { mathjax } from "#js/mathjax.js"; +import { Configuration } from '#js/input/tex/Configuration.js'; +import { CommandMap } from '#js/input/tex/TokenMap.js'; +import TexParser from '#js/input/tex/TexParser.js'; +import { mathjax } from '#js/mathjax.js'; /**********************************************************************************/ @@ -20,57 +20,96 @@ new CommandMap('retry', { parser.options.retry = true; mathjax.retryAfter(Promise.resolve()); } - } + }, }); -Configuration.create('retry', {handler: {macro: ['retry']}}); +Configuration.create('retry', { handler: { macro: ['retry'] } }); /**********************************************************************************/ describe('Begingroup', () => { - - beforeEach(() => setupTex(['base', 'begingroup', 'newcommand', 'retry'], { - formatError: (_jax: any, err: Error) => {throw err} - })); + beforeEach(() => + setupTex(['base', 'begingroup', 'newcommand', 'retry'], { + formatError: (_jax: any, err: Error) => { + throw err; + }, + }) + ); test('Begingroup Def Single', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\endgroup \\x') + ).toMatchSnapshot(); }); test('Begingroup Def Nested', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\begingroup \\def\\x{C} \\x \\endgroup \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\begingroup \\def\\x{C} \\x \\endgroup \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Let Single', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\endgroup \\x') + ).toMatchSnapshot(); }); test('Begingroup Let Nested', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\begingroup \\let\\x=C \\x \\endgroup \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\begingroup \\let\\x=C \\x \\endgroup \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Env Single', () => { - expect(tex2mml('\\newenvironment{test}{[}{]}\\begin{test}X\\end{test}\\begingroup\\newenvironment{test}{(}{)}\\begin{test}X\\end{test}\\endgroup\\begin{test}X\\end{test}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newenvironment{test}{[}{]}\\begin{test}X\\end{test}\\begingroup\\newenvironment{test}{(}{)}\\begin{test}X\\end{test}\\endgroup\\begin{test}X\\end{test}' + ) + ).toMatchSnapshot(); }); test('Begingroup Delimiter Single', () => { - expect(tex2mml('\\let\\x=\\| \\left\\x A\\right\\x \\begingroup \\let\\x=| \\left\\x B \\right\\x \\endgroup \\left\\x C \\right\\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\let\\x=\\| \\left\\x A\\right\\x \\begingroup \\let\\x=| \\left\\x B \\right\\x \\endgroup \\left\\x C \\right\\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Delimiter Nested', () => { - expect(tex2mml('\\let\\x=\\| \\left\\x A\\right\\x \\begingroup \\let\\x=| \\left\\x B \\right\\x \\begingroup \\let\\x=( \\left\\x C \\right\\x \\endgroup \\left\\x D \\right\\x \\endgroup \\left\\x E \\right\\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\let\\x=\\| \\left\\x A\\right\\x \\begingroup \\let\\x=| \\left\\x B \\right\\x \\begingroup \\let\\x=( \\left\\x C \\right\\x \\endgroup \\left\\x D \\right\\x \\endgroup \\left\\x E \\right\\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Global', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\global\\def\\x{C} \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\global\\def\\x{C} \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Global Nested', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\begingroup \\gdef\\x{C} \\x \\endgroup \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\def\\x{B} \\x \\begingroup \\gdef\\x{C} \\x \\endgroup \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Global Let', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\global\\let\\x=C \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\let\\x=B \\x \\global\\let\\x=C \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup Persists', () => { @@ -79,15 +118,21 @@ describe('Begingroup', () => { }); test('Begingroup Reset', () => { - expect(tex2mml('\\def\\x{A} \\begingroup \\def\\x{B} \\begingroupReset \\x')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x{A} \\begingroup \\def\\x{B} \\begingroupReset \\x') + ).toMatchSnapshot(); }); test('Begingroup End without Begin', () => { - expectTexError('\\endgroup').toBe('Missing \\begingroup or extra \\endgroup'); + expectTexError('\\endgroup').toBe( + 'Missing \\begingroup or extra \\endgroup' + ); }); test('Begingroup End without Begin 2', () => { - expectTexError('\\begingroup \\endgroup \\endgroup').toBe('Missing \\begingroup or extra \\endgroup'); + expectTexError('\\begingroup \\endgroup \\endgroup').toBe( + 'Missing \\begingroup or extra \\endgroup' + ); }); test('Begingroup global misplaced', () => { @@ -96,56 +141,86 @@ describe('Begingroup', () => { }); test('Begingroup reset', () => { - expectTexError('\\begingroup \\begingroupReset \\endgroup').toBe('Missing \\begingroup or extra \\endgroup'); + expectTexError('\\begingroup \\begingroupReset \\endgroup').toBe( + 'Missing \\begingroup or extra \\endgroup' + ); }); test('Begingroup reset 2', () => { - expect(tex2mml('\\def\\x{A} \\begingroup \\def\\x{B} \\begingroupReset \\x')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x{A} \\begingroup \\def\\x{B} \\begingroupReset \\x') + ).toMatchSnapshot(); }); test('Begingroup let undefined', () => { - expectTexError('\\def\\x{A} \\begingroup \\let\\x=\\undefined \\x \\endgroup') - .toBe('Undefined control sequence \\x'); + expectTexError( + '\\def\\x{A} \\begingroup \\let\\x=\\undefined \\x \\endgroup' + ).toBe('Undefined control sequence \\x'); }); test('Begingroup let undefined 2', () => { - expect(tex2mml('\\def\\x{A} \\begingroup \\let\\x=\\undefined \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x{A} \\begingroup \\let\\x=\\undefined \\endgroup \\x') + ).toMatchSnapshot(); }); test('Begingroup global def undefines local delimiter', () => { - expect(tex2mml('\\def\\x{A} \\x \\begingroup \\let\\x=\\| \\x \\begingroup \\gdef\\x{C} \\x \\endgroup \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\x \\begingroup \\let\\x=\\| \\x \\begingroup \\gdef\\x{C} \\x \\endgroup \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup global let delimiter undefines local def', () => { - expect(tex2mml('\\let\\x=| \\x \\begingroup \\def\\x{A} \\x \\begingroup \\global\\let\\x=\\| \\x \\endgroup \\x \\endgroup \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\let\\x=| \\x \\begingroup \\def\\x{A} \\x \\begingroup \\global\\let\\x=\\| \\x \\endgroup \\x \\endgroup \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup sandbox', () => { - expect(tex2mml('\\def\\x{A} \\begingroupSandbox \\def\\x{B} \\begingroupReset \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\begingroupSandbox \\def\\x{B} \\begingroupReset \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup double sandbox', () => { - expect(tex2mml('\\def\\x{A} \\begingroupSandbox \\def\\x{B} \\begingroupSandbox \\x')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\x{A} \\begingroupSandbox \\def\\x{B} \\begingroupSandbox \\x' + ) + ).toMatchSnapshot(); }); test('Begingroup sandbox not ended', () => { - expectTexError('\\begingroupSandbox \\endgroup').toBe('Missing \\begingroup or extra \\endgroup'); + expectTexError('\\begingroupSandbox \\endgroup').toBe( + 'Missing \\begingroup or extra \\endgroup' + ); }); test('Begingroup sandbox redefine', () => { - expectTexError('\\let\\begingroupSandbox=\\undefined') - .toBe("The control sequence \\begingroupSandbox can't be redefined"); - expectTexError('\\def\\begingroupSandbox{x}') - .toBe("The control sequence \\begingroupSandbox can't be redefined"); - expectTexError('\\newcommand{\\begingroupSandbox}{x}') - .toBe("The control sequence \\begingroupSandbox can't be redefined"); + expectTexError('\\let\\begingroupSandbox=\\undefined').toBe( + "The control sequence \\begingroupSandbox can't be redefined" + ); + expectTexError('\\def\\begingroupSandbox{x}').toBe( + "The control sequence \\begingroupSandbox can't be redefined" + ); + expectTexError('\\newcommand{\\begingroupSandbox}{x}').toBe( + "The control sequence \\begingroupSandbox can't be redefined" + ); }); test('Begingroup with retry', async () => { - await expect(mathjax.handleRetriesFor( - () => tex2mml('\\sin \\begingroup\\def\\sin{SIN}\\retry\\endgroup') - )).resolves.toBe( - ` + await expect( + mathjax.handleRetriesFor(() => + tex2mml('\\sin \\begingroup\\def\\sin{SIN}\\retry\\endgroup') + ) + ).resolves.toBe( + ` sin ` ); @@ -153,28 +228,37 @@ describe('Begingroup', () => { test('Begingroup sandbox with retry', async () => { tex2mml('\\def\\x{A}\\begingroupSandbox'); - await expect(mathjax.handleRetriesFor( - () => tex2mml('\\x \\begingroup\\def\\x{B}\\retry\\endgroup') - )).resolves.toBe( - ` + await expect( + mathjax.handleRetriesFor(() => + tex2mml('\\x \\begingroup\\def\\x{B}\\retry\\endgroup') + ) + ).resolves.toBe( + ` A ` ); }); test('Begingroup retry error', async () => { - await expect(mathjax.handleRetriesFor( - () => tex2mml('\\begingroup\\retry\\endgroup\\endgroup') - ).catch((e) => e.message)).resolves.toBe('Missing \\begingroup or extra \\endgroup'); + await expect( + mathjax + .handleRetriesFor(() => + tex2mml('\\begingroup\\retry\\endgroup\\endgroup') + ) + .catch((e) => e.message) + ).resolves.toBe('Missing \\begingroup or extra \\endgroup'); }); test('Begingroup sandbox retry error', async () => { tex2mml('\\begingroupSandbox'); - await expect(mathjax.handleRetriesFor( - () => tex2mml('\\begingroup\\retry\\endgroup\\endgroup') - ).catch((e) => e.message)).resolves.toBe('Missing \\begingroup or extra \\endgroup'); + await expect( + mathjax + .handleRetriesFor(() => + tex2mml('\\begingroup\\retry\\endgroup\\endgroup') + ) + .catch((e) => e.message) + ).resolves.toBe('Missing \\begingroup or extra \\endgroup'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Boldsymbol.test.ts b/testsuite/tests/input/tex/Boldsymbol.test.ts index bba9e026b..8bdcb33f0 100644 --- a/testsuite/tests/input/tex/Boldsymbol.test.ts +++ b/testsuite/tests/input/tex/Boldsymbol.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'boldsymbol'])); /**********************************************************************************/ describe('Boldsymbol', () => { - it('Boldsymbol Single', () => { expect(tex2mml('\\boldsymbol{a}')).toMatchSnapshot(); }); @@ -25,13 +24,14 @@ describe('Boldsymbol', () => { }); it('Boldsymbol Recursive', () => { - expect(tex2mml('\\boldsymbol{a+b\\mbox{ w $c+\\boldsymbol{d+e}$ w } q-} -q')).toMatchSnapshot(); + expect( + tex2mml('\\boldsymbol{a+b\\mbox{ w $c+\\boldsymbol{d+e}$ w } q-} -q') + ).toMatchSnapshot(); }); it('Boldsymbol Variant', () => { expect(tex2mml('\\boldsymbol{A\\mathbb{B}C}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Braket.test.ts b/testsuite/tests/input/tex/Braket.test.ts index 34ed4cfe9..fed327eea 100644 --- a/testsuite/tests/input/tex/Braket.test.ts +++ b/testsuite/tests/input/tex/Braket.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'braket'])); /**********************************************************************************/ describe('Braket', () => { - it('Braket-bra', () => { expect(tex2mml('\\bra{x}')).toMatchSnapshot(); }); @@ -129,20 +128,16 @@ describe('Braket', () => { }); it('Braket-error', () => { - expectTexError('\\braket') - .toBe('Missing argument for \\braket'); + expectTexError('\\braket').toBe('Missing argument for \\braket'); }); it('Braket-braces', () => { - expectTexError('\\braket{') - .toBe('Missing close brace'); + expectTexError('\\braket{').toBe('Missing close brace'); }); it('Braket-braces', () => { - expectTexError('\\braket}') - .toBe('Extra close brace or missing open brace'); + expectTexError('\\braket}').toBe('Extra close brace or missing open brace'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Bussproofs.test.ts b/testsuite/tests/input/tex/Bussproofs.test.ts index 3aaa80ba2..25c72158d 100644 --- a/testsuite/tests/input/tex/Bussproofs.test.ts +++ b/testsuite/tests/input/tex/Bussproofs.test.ts @@ -8,159 +8,207 @@ beforeEach(() => setupTexWithOutput(['base', 'ams', 'bussproofs'])); /**********************************************************************************/ describe('BussproofsRegInf', () => { - it('Single Axiom', () => { - expect(tex2mml('\\begin{prooftree}\\AxiomC{A}\\end{prooftree}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{prooftree}\\AxiomC{A}\\end{prooftree}') + ).toMatchSnapshot(); }); it('Unary Inference', () => { - expect(tex2mml('\\begin{prooftree}\\AxiomC{A}\\UnaryInfC{B}\\end{prooftree}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{prooftree}\\AxiomC{A}\\UnaryInfC{B}\\end{prooftree}') + ).toMatchSnapshot(); }); it('Binary Inference', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\AxiomC{B}\\BinaryInfC{C}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Trinary Inference', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\AxiomC{B}\\AxiomC{C}\\TrinaryInfC{D}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Quaternary Inference', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\AxiomC{B}\\AxiomC{C}\\AxiomC{D}\\QuaternaryInfC{E}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Quinary Inference', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\AxiomC{B}\\AxiomC{C}\\AxiomC{D}\\AxiomC{E}\\QuinaryInfC{F}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Left', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\LeftLabel{L}\\UnaryInfC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Right', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\RightLabel{R}\\UnaryInfC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Both', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{A}\\LeftLabel{L}\\RightLabel{R}\\UnaryInfC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Single Axiom Abbr', () => { - expect(tex2mml('\\begin{prooftree}\\AXC{A}\\end{prooftree}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{prooftree}\\AXC{A}\\end{prooftree}') + ).toMatchSnapshot(); }); it('Unary Inference Abbr', () => { - expect(tex2mml('\\begin{prooftree}\\AXC{A}\\UIC{B}\\end{prooftree}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{prooftree}\\AXC{A}\\UIC{B}\\end{prooftree}') + ).toMatchSnapshot(); }); it('Binary Inference Abbr', () => { - expect(tex2mml('\\begin{prooftree}\\AXC{A}\\AXC{B}\\BIC{C}\\end{prooftree}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{prooftree}\\AXC{A}\\AXC{B}\\BIC{C}\\end{prooftree}') + ).toMatchSnapshot(); }); it('Trinary Inference Abbr', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AXC{A}\\AXC{B}\\AXC{C}\\TIC{D}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Left Abbr', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AXC{A}\\LeftLabel{L}\\UIC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Right Abbr', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AXC{A}\\RightLabel{R}\\UIC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Label Both Abbr', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AXC{A}\\LeftLabel{L}\\RightLabel{R}\\UIC{B}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('BussproofsRegProofs', () => { - it('Simple Proof', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\BinaryInfC{E}\\BinaryInfC{F}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Simple Proof Noise', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}$\\alpha$\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\BinaryInfC{E}\\BinaryInfC{F}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Simple Proof Large', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\TrinaryInfC{Q}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\BinaryInfC{E}\\BinaryInfC{F}\\AxiomC{M}\\BinaryInfC{$N \\rightarrow R$}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Simple Proofs Right Labels', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\TrinaryInfC{Q}\\RightLabel{AAAA}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\RightLabel{BBB}\\BinaryInfC{E}\\RightLabel{CCCCC}\\BinaryInfC{F}\\RightLabel{QERE}\\AxiomC{M}\\BinaryInfC{$N \\rightarrow R$}\\RightLabel{Nowhere}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Simple Proofs Left Labels', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\TrinaryInfC{Q}\\LeftLabel{AAAA}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\LeftLabel{BBB}\\BinaryInfC{E}\\LeftLabel{CCCCC}\\BinaryInfC{F}\\LeftLabel{QERE}\\AxiomC{M}\\BinaryInfC{$N \\rightarrow R$}\\LeftLabel{Nowhere}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Simple Proofs Mixed Labels', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\TrinaryInfC{Q}\\RightLabel{AAAA}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\LeftLabel{BBB}\\BinaryInfC{E}\\LeftLabel{CCCCC}\\BinaryInfC{F}\\RightLabel{QERE}\\LeftLabel{DD}\\AxiomC{M}\\BinaryInfC{$N \\rightarrow R$}\\LeftLabel{Nowhere}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Proof Very Right Label', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\RightLabel{AAAA}\\TrinaryInfC{Q}\\RightLabel{Nowhere}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\RightLabel{BBB}\\BinaryInfC{E}\\RightLabel{CCCCC}\\BinaryInfC{F}\\RightLabel{QERE}\\AxiomC{M}\\UnaryInfC{More and more}\\UnaryInfC{More and more}\\UnaryInfC{More and more}\\BinaryInfC{$N \\rightarrow R$}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Proof Complex', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\AXC{}\\RL{$Hyp^{1}$}\\UIC{$P$}\\AXC{$P\\rightarrow Q$}\\RL{$\\rightarrow_E$}\\solidLine\\BIC{$Q^2$}\\AXC{$Q\\rightarrow R$} \\RL{$\\rightarrow_E$} \\BIC{$R$} \\AXC{$Q$}\\RL{Rit$^2$} \\UIC{$Q$}\\RL{$\\wedge_I$}\\BIC{$Q\\wedge R$}\\RL{${\\rightarrow_I}^1$}\\UIC{$P\\rightarrow Q\\wedge R$}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Proof Mixing Order', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\alwaysRootAtTop\\AXC{}\\RL{$Hyp^{1}$}\\UIC{$P$}\\AXC{$P\\rightarrow Q$}\\RL{$\\rightarrow_E$}\\solidLine\\BIC{$Q^2$}\\alwaysRootAtBottom\\AXC{$Q\\rightarrow R$} \\RL{$\\rightarrow_E$} \\BIC{$R$} \\AXC{$Q$}\\RL{Rit$^2$} \\UIC{$Q$}\\RL{$\\wedge_I$}\\BIC{$Q\\wedge R$}\\RL{\${\\rightarrow_I}^1$}\\UIC{$P\\rightarrow Q\\wedge R$}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Extreme', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{prooftree}\\LL{HHHHH}\\RL{11111111111111111}\\AxiomC{D}\\AxiomC{A1}\\AxiomC{A2}\\TrinaryInfC{Q}\\RightLabel{AAAA}\\AxiomC{A}\\AxiomC{B}\\AxiomC{R}\\LL{qqqq}\\BinaryInfC{$C \\rightarrow D \\rightarrow Q$}\\LeftLabel{BBBB}\\RightLabel{MMM}\\BinaryInfC{E}\\RightLabel{CCCCC}\\LL{WWW}\\BinaryInfC{F}\\RightLabel{QERE}\\AxiomC{M}\\LL{BBB}\\BinaryInfC{$N \\rightarrow R$}\\RightLabel{Nowhere}\\end{prooftree}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Cancel.test.ts b/testsuite/tests/input/tex/Cancel.test.ts index fc11a67b5..d4e5b8a3f 100644 --- a/testsuite/tests/input/tex/Cancel.test.ts +++ b/testsuite/tests/input/tex/Cancel.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'cancel'])); /**********************************************************************************/ describe('Cancel', () => { - it('Cancel', () => { expect(tex2mml('\\cancel{x}')).toMatchSnapshot(); }); @@ -29,7 +28,9 @@ describe('Cancel', () => { }); it('Cancel Attrs', () => { - expect(tex2mml('\\cancel[mathcolor=green,mathbackground=yellow]{x}')).toMatchSnapshot(); + expect( + tex2mml('\\cancel[mathcolor=green,mathbackground=yellow]{x}') + ).toMatchSnapshot(); }); it('Cancel Attr Not Allowed', () => { @@ -37,9 +38,10 @@ describe('Cancel', () => { }); it('CancelTo Attrs', () => { - expect(tex2mml('\\cancelto[data-padding=5,data-arrowhead=15]{x}{y}')).toMatchSnapshot(); + expect( + tex2mml('\\cancelto[data-padding=5,data-arrowhead=15]{x}{y}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Cases.test.ts b/testsuite/tests/input/tex/Cases.test.ts index 39231d23a..a2bf67bb0 100644 --- a/testsuite/tests/input/tex/Cases.test.ts +++ b/testsuite/tests/input/tex/Cases.test.ts @@ -4,32 +4,43 @@ import '#js/input/tex/cases/CasesConfiguration'; import '#js/input/tex/empheq/EmpheqConfiguration'; import '#js/input/tex/ams/AmsConfiguration'; -beforeEach(() => setupTex(['base', 'ams', 'cases'], {tags: 'cases'})); +beforeEach(() => setupTex(['base', 'ams', 'cases'], { tags: 'cases' })); /**********************************************************************************/ describe('Cases', () => { - test('Numcases', () => { - expect(tex2mml('\\begin{numcases}{f(x)=} 1 & if $x > 0$ \\\\ 0 & otherwise \\end{numcases}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{numcases}{f(x)=} 1 & if $x > 0$ \\\\ 0 & otherwise \\end{numcases}' + ) + ).toMatchSnapshot(); }); test('subnumcases', () => { - expect(tex2mml('\\begin{subnumcases}{f(x)=} 1 & if $x > 0$ \\\\ 0 & otherwise \\end{subnumcases}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{subnumcases}{f(x)=} 1 & if $x > 0$ \\\\ 0 & otherwise \\end{subnumcases}' + ) + ).toMatchSnapshot(); }); test('Numcases with macro', () => { - expect(tex2mml('\\begin{numcases}{A=} 1 & if {x\\\\y}\\$ \\end{numcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{numcases}{A=} 1 & if {x\\\\y}\\$ \\end{numcases}') + ).toMatchSnapshot(); }); test('numcases extra brace', () => { - expectTexError('\\begin{numcases}{A=} x & } \\end{numcases}') - .toBe('Extra close brace or missing open brace'); + expectTexError('\\begin{numcases}{A=} x & } \\end{numcases}').toBe( + 'Extra close brace or missing open brace' + ); }); test('numcases extra column', () => { - expectTexError('\\begin{numcases}{A=} x & y & z \\end{numcases}') - .toBe('Extra alignment tab in text for numcase environment'); + expectTexError('\\begin{numcases}{A=} x & y & z \\end{numcases}').toBe( + 'Extra alignment tab in text for numcase environment' + ); }); test('entry not in numcases', () => { @@ -37,14 +48,16 @@ describe('Cases', () => { }); test('numcases with explicit tag', () => { - expect(tex2mml('\\begin{numcases}{A=} x\\tag{A} & y \\end{numcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{numcases}{A=} x\\tag{A} & y \\end{numcases}') + ).toMatchSnapshot(); }); test('numcases not complete', () => { - expectTexError('\\begin{numcases}{A=} x & y\\') - .toBe('Missing \\end{numcases}'); + expectTexError('\\begin{numcases}{A=} x & y\\').toBe( + 'Missing \\end{numcases}' + ); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Centernot.test.ts b/testsuite/tests/input/tex/Centernot.test.ts index 2ce5e8c22..98efe39b0 100644 --- a/testsuite/tests/input/tex/Centernot.test.ts +++ b/testsuite/tests/input/tex/Centernot.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'centernot'])); /**********************************************************************************/ describe('Centernot', () => { - test('Centernot', () => { expect(tex2mml('\\centernot{\\longrightarrow}')).toMatchSnapshot(); }); @@ -15,7 +14,6 @@ describe('Centernot', () => { test('Centerover', () => { expect(tex2mml('\\centerOver{\\bigcirc}{1}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Color.test.ts b/testsuite/tests/input/tex/Color.test.ts index 4b3baf10a..efe0f27a0 100644 --- a/testsuite/tests/input/tex/Color.test.ts +++ b/testsuite/tests/input/tex/Color.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'color'])); /**********************************************************************************/ describe('Color named', () => { - test('Color extent', () => { expect(tex2mml('\\color{red} x+y')).toMatchSnapshot(); }); @@ -25,7 +24,9 @@ describe('Color named', () => { }); test('Textcolor nested', () => { - expect(tex2mml('\\textcolor{red}{\\textcolor{blue}{a} b}')).toMatchSnapshot(); + expect( + tex2mml('\\textcolor{red}{\\textcolor{blue}{a} b}') + ).toMatchSnapshot(); }); test('Colorbox', () => { @@ -37,15 +38,15 @@ describe('Color named', () => { }); test('Definecolor', () => { - expect(tex2mml('\\definecolor{test}{named}{#48C}\\color{test} a')).toMatchSnapshot(); + expect( + tex2mml('\\definecolor{test}{named}{#48C}\\color{test} a') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Color rgb', () => { - test('Color extent', () => { expect(tex2mml('\\color[rgb]{1,0,0} x+y')).toMatchSnapshot(); }); @@ -59,7 +60,9 @@ describe('Color rgb', () => { }); test('Textcolor nested', () => { - expect(tex2mml('\\textcolor[rgb]{1,0,0}{\\textcolor[rgb]{0,0,1}{a} b}')).toMatchSnapshot(); + expect( + tex2mml('\\textcolor[rgb]{1,0,0}{\\textcolor[rgb]{0,0,1}{a} b}') + ).toMatchSnapshot(); }); test('Colorbox', () => { @@ -67,19 +70,21 @@ describe('Color rgb', () => { }); test('Fcolorbox', () => { - expect(tex2mml('\\fcolorbox[rgb]{1,0,0}[rgb]{1,1,0}{a b}')).toMatchSnapshot(); + expect( + tex2mml('\\fcolorbox[rgb]{1,0,0}[rgb]{1,1,0}{a b}') + ).toMatchSnapshot(); }); test('Definecolor', () => { - expect(tex2mml('\\definecolor{test}{rgb}{.25,.5,.75}\\color{test} a')).toMatchSnapshot(); + expect( + tex2mml('\\definecolor{test}{rgb}{.25,.5,.75}\\color{test} a') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Color RGB', () => { - test('Color extent', () => { expect(tex2mml('\\color[RGB]{255,0,0} x+y')).toMatchSnapshot(); }); @@ -93,7 +98,9 @@ describe('Color RGB', () => { }); test('Textcolor nested', () => { - expect(tex2mml('\\textcolor[RGB]{255,0,0}{\\textcolor[RGB]{0,0,255}{a} b}')).toMatchSnapshot(); + expect( + tex2mml('\\textcolor[RGB]{255,0,0}{\\textcolor[RGB]{0,0,255}{a} b}') + ).toMatchSnapshot(); }); test('Colorbox', () => { @@ -101,19 +108,21 @@ describe('Color RGB', () => { }); test('Fcolorbox', () => { - expect(tex2mml('\\fcolorbox[RGB]{255,0,0}[RGB]{255,255,0}{a b}')).toMatchSnapshot(); + expect( + tex2mml('\\fcolorbox[RGB]{255,0,0}[RGB]{255,255,0}{a b}') + ).toMatchSnapshot(); }); test('Definecolor', () => { - expect(tex2mml('\\definecolor{test}{RGB}{8,128,200}\\color{test} a')).toMatchSnapshot(); + expect( + tex2mml('\\definecolor{test}{RGB}{8,128,200}\\color{test} a') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Color gray', () => { - test('Color extent', () => { expect(tex2mml('\\color[gray]{.5} x+y')).toMatchSnapshot(); }); @@ -127,7 +136,9 @@ describe('Color gray', () => { }); test('Textcolor nested', () => { - expect(tex2mml('\\textcolor[gray]{.5}{\\textcolor[gray]{.75}{a} b}')).toMatchSnapshot(); + expect( + tex2mml('\\textcolor[gray]{.5}{\\textcolor[gray]{.75}{a} b}') + ).toMatchSnapshot(); }); test('Colorbox', () => { @@ -139,70 +150,74 @@ describe('Color gray', () => { }); test('Definecolor', () => { - expect(tex2mml('\\definecolor{test}{gray}{.02}\\color{test} a')).toMatchSnapshot(); + expect( + tex2mml('\\definecolor{test}{gray}{.02}\\color{test} a') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Color errors', () => { - test('UndefinedColormodel', () => { - expectTexError('\\color[error]{error} x') - .toBe("Color model 'error' not defined"); + expectTexError('\\color[error]{error} x').toBe( + "Color model 'error' not defined" + ); }); test('ModelArg1 rgb', () => { - expectTexError('\\definecolor{test}{rgb}{1}') - .toBe('Color values for the rgb model require 3 numbers'); + expectTexError('\\definecolor{test}{rgb}{1}').toBe( + 'Color values for the rgb model require 3 numbers' + ); }); test('InvalidDecimalNumber rgb', () => { - expectTexError('\\definecolor{test}{rgb}{x,x,x}') - .toBe('Invalid decimal number'); + expectTexError('\\definecolor{test}{rgb}{x,x,x}').toBe( + 'Invalid decimal number' + ); }); test('ModelArg2 rgb', () => { - expectTexError('\\definecolor{test}{rgb}{10,10,10}') - .toBe('Color values for the rgb model must be between 0 and 1'); + expectTexError('\\definecolor{test}{rgb}{10,10,10}').toBe( + 'Color values for the rgb model must be between 0 and 1' + ); }); test('ModelArg1 RGB', () => { - expectTexError('\\definecolor{test}{RGB}{1}') - .toBe('Color values for the RGB model require 3 numbers'); + expectTexError('\\definecolor{test}{RGB}{1}').toBe( + 'Color values for the RGB model require 3 numbers' + ); }); test('InvalidDecimalNumber RGB', () => { - expectTexError('\\definecolor{test}{RGB}{x,x,x}') - .toBe('Invalid number'); + expectTexError('\\definecolor{test}{RGB}{x,x,x}').toBe('Invalid number'); }); test('ModelArg2 RGB', () => { - expectTexError('\\definecolor{test}{RGB}{1000,1000,1000}') - .toBe('Color values for the RGB model must be between 0 and 255'); + expectTexError('\\definecolor{test}{RGB}{1000,1000,1000}').toBe( + 'Color values for the RGB model must be between 0 and 255' + ); }); test('InvalidDecimalNumber gray', () => { - expectTexError('\\definecolor{test}{gray}{x}') - .toBe('Invalid decimal number'); + expectTexError('\\definecolor{test}{gray}{x}').toBe( + 'Invalid decimal number' + ); }); test('ModelArg2 gray', () => { - expectTexError('\\definecolor{test}{gray}{10}') - .toBe('Color values for the gray model must be between 0 and 1'); + expectTexError('\\definecolor{test}{gray}{10}').toBe( + 'Color values for the gray model must be between 0 and 1' + ); }); test('BadColorValue', () => { - expectTexError('\\definecolor{error}{}{a;b}') - .toBe('Invalid color value'); + expectTexError('\\definecolor{error}{}{a;b}').toBe('Invalid color value'); }); test('BadColorValue named', () => { - expectTexError('\\color[named]{a;b}{x}') - .toBe('Invalid color value'); + expectTexError('\\color[named]{a;b}{x}').toBe('Invalid color value'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Colortbl.test.ts b/testsuite/tests/input/tex/Colortbl.test.ts index 6c7f13da9..f4475a961 100644 --- a/testsuite/tests/input/tex/Colortbl.test.ts +++ b/testsuite/tests/input/tex/Colortbl.test.ts @@ -11,73 +11,118 @@ beforeEach(() => setupTex(['base', 'colortbl'])); /**********************************************************************************/ describe('Colortbl', () => { - test('cellcolor', () => { - expect(tex2mml('\\begin{array}{cc} a & \\cellcolor{red} b \\\\ \\cellcolor{yellow} c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\cellcolor{red} b \\\\ \\cellcolor{yellow} c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor late', () => { - expect(tex2mml('\\begin{array}{cc} a & b \\cellcolor{red} \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{cc} a & b \\cellcolor{red} \\end{array}') + ).toMatchSnapshot(); }); test('rowcolor', () => { - expect(tex2mml('\\begin{array}{cc} a & b \\\\ \\rowcolor{yellow} c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & b \\\\ \\rowcolor{yellow} c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('rowcolor late', () => { - expectTexError('\\begin{array}{cc} a & b \\\\ c & \\rowcolor{yellow} d \\end{array}') - .toBe('\\rowcolor must be at the beginning of a row'); + expectTexError( + '\\begin{array}{cc} a & b \\\\ c & \\rowcolor{yellow} d \\end{array}' + ).toBe('\\rowcolor must be at the beginning of a row'); }); test('columncolor', () => { - expect(tex2mml('\\begin{array}{cc} a & \\columncolor{yellow} b \\\\ c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\columncolor{yellow} b \\\\ c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('columncolor late', () => { - expectTexError('\\begin{array}{cc} a & b \\\\ c & \\columncolor{yellow} d \\end{array}') - .toBe('\\columncolor must be in the top row or preamble'); + expectTexError( + '\\begin{array}{cc} a & b \\\\ c & \\columncolor{yellow} d \\end{array}' + ).toBe('\\columncolor must be in the top row or preamble'); }); test('columncolor in preamble', () => { - expect(tex2mml('\\begin{array}{c>{\\columncolor{yellow}}c} a & b \\\\ c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{c>{\\columncolor{yellow}}c} a & b \\\\ c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor in preamble', () => { - expect(tex2mml('\\begin{array}{c>{\\cellcolor{yellow}}c} a & b \\\\ c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{c>{\\cellcolor{yellow}}c} a & b \\\\ c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor with rowcolor', () => { - expect(tex2mml('\\begin{array}{cc} a & b \\\\ \\rowcolor{red} c & \\cellcolor{yellow} d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & b \\\\ \\rowcolor{red} c & \\cellcolor{yellow} d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor with columncolor', () => { - expect(tex2mml('\\begin{array}{cc} a & \\columncolor{red} b \\\\ c & \\cellcolor{yellow} d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\columncolor{red} b \\\\ c & \\cellcolor{yellow} d \\end{array}' + ) + ).toMatchSnapshot(); }); test('columncolor and rowcolor', () => { - expect(tex2mml('\\begin{array}{cc} a & \\columncolor{red} b \\\\ \\rowcolor{yellow} c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\columncolor{red} b \\\\ \\rowcolor{yellow} c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor with columncolor and rowcolor', () => { - expect(tex2mml('\\begin{array}{cc} a & \\columncolor{red} b \\\\ \\rowcolor{yellow} c & \\cellcolor{green} d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\columncolor{red} b \\\\ \\rowcolor{yellow} c & \\cellcolor{green} d \\end{array}' + ) + ).toMatchSnapshot(); }); test('columncolor ignore overlap', () => { - expect(tex2mml('\\begin{array}{cc} a & \\columncolor{red}[ignore][ignore] b \\\\ c & d \\end{array}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{array}{cc} a & \\columncolor{red}[ignore][ignore] b \\\\ c & d \\end{array}' + ) + ).toMatchSnapshot(); }); test('cellcolor outside of table', () => { - expectTexError('\\cellcolor{red}') - .toBe('Unsupported use of \\cellcolor'); + expectTexError('\\cellcolor{red}').toBe('Unsupported use of \\cellcolor'); }); test('cellcolor nested', () => { - expectTexError('\\begin{array}{c} \\frac{\\cellcolor{red} a}{b} \\end{array}') - .toBe('Unsupported use of \\cellcolor'); + expectTexError( + '\\begin{array}{c} \\frac{\\cellcolor{red} a}{b} \\end{array}' + ).toBe('Unsupported use of \\cellcolor'); }); test('cellcolor with frame', () => { - expect(tex2mml('\\begin{array}{|c|} \\cellcolor{red} a \\end{array}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{array}{|c|} \\cellcolor{red} a \\end{array}') + ).toMatchSnapshot(); }); test('cellcolor in pmatrix', () => { @@ -96,13 +141,12 @@ describe('Colortbl', () => { } } Configuration.create('nopadding', { - [ConfigurationType.ITEMS]: {array: myArrayItem}, - [ConfigurationType.PRIORITY]: 20 + [ConfigurationType.ITEMS]: { array: myArrayItem }, + [ConfigurationType.PRIORITY]: 20, }); setupTex(['base', 'colortbl', 'nopadding']); expect(tex2mml('\\matrix{ \\cellcolor[rgb]{1,0,0} a }')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Colorv2.test.ts b/testsuite/tests/input/tex/Colorv2.test.ts index e4f5ac8fa..5ed26d264 100644 --- a/testsuite/tests/input/tex/Colorv2.test.ts +++ b/testsuite/tests/input/tex/Colorv2.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'colorv2'])); /**********************************************************************************/ describe('ColorV2', () => { - it('Color Open', () => { expect(tex2mml('\\color{red}{ab}')).toMatchSnapshot(); }); @@ -17,13 +16,14 @@ describe('ColorV2', () => { }); it('Color Frac', () => { - expect(tex2mml('\\frac{{\\cal \\color{red}{X}}}{\\color{blue}{\\sf y}}')).toMatchSnapshot(); + expect( + tex2mml('\\frac{{\\cal \\color{red}{X}}}{\\color{blue}{\\sf y}}') + ).toMatchSnapshot(); }); it('Color Nested', () => { expect(tex2mml('\\color{red}{a\\color{blue}{b}c}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/ConfigMacros.test.ts b/testsuite/tests/input/tex/ConfigMacros.test.ts index 91bc67f03..395805c1d 100644 --- a/testsuite/tests/input/tex/ConfigMacros.test.ts +++ b/testsuite/tests/input/tex/ConfigMacros.test.ts @@ -5,9 +5,10 @@ import '#js/input/tex/configmacros/ConfigMacrosConfiguration'; beforeEach(() => {}); function runMacroTests( - macros: {[key: string]: any}, + macros: { [key: string]: any }, control: string, - macro: string) { + macro: string +) { setupTex(['base', 'configmacros'], macros); expect(tex2mml(control)).toMatchSnapshot(); expect(tex2mml(macro)).toMatchSnapshot(); @@ -16,24 +17,21 @@ function runMacroTests( /**********************************************************************************/ describe('Config Macros Active', () => { - it('Macros Simple', () => { - runMacroTests({active: {"@": "~"}}, 'A~a', 'A@a'); + runMacroTests({ active: { '@': '~' } }, 'A~a', 'A@a'); }); - }); /**********************************************************************************/ describe('Config Macros Commands', () => { - it('Commands Simple', () => { - runMacroTests({macros: {"RR": "{\\bf R}"}}, '{\\bf R}', '\\RR'); + runMacroTests({ macros: { RR: '{\\bf R}' } }, '{\\bf R}', '\\RR'); }); it('Commands Argument', () => { runMacroTests( - {macros: {"bold": ["{\\bf #1}", 1]}}, + { macros: { bold: ['{\\bf #1}', 1] } }, '{\\bf bold}', '\\bold{bold}' ); @@ -41,26 +39,27 @@ describe('Config Macros Commands', () => { it('Commands Aux Argument', () => { runMacroTests( - {macros: {"foo": ["\\mbox{first } #1 \\mbox{ second } #2", 2, ["[", "]"]]}}, + { + macros: { + foo: ['\\mbox{first } #1 \\mbox{ second } #2', 2, ['[', ']']], + }, + }, '\\mbox{first } hi \\mbox{ second } there', '\\foo[hi]{there}' ); }); - }); /**********************************************************************************/ describe('Config Macros Environment', () => { - it('Environment Simple', () => { runMacroTests( - {environments: {"myHeartEnv": ["\\heartsuit", "\\spadesuit"]}}, + { environments: { myHeartEnv: ['\\heartsuit', '\\spadesuit'] } }, '\\begin{myHeartEnv}a\\end{myHeartEnv}', '\\begin{myHeartEnv}a\\end{myHeartEnv}' ); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Dsfont.test.ts b/testsuite/tests/input/tex/Dsfont.test.ts index 7e1c46531..0311c506d 100644 --- a/testsuite/tests/input/tex/Dsfont.test.ts +++ b/testsuite/tests/input/tex/Dsfont.test.ts @@ -5,25 +5,21 @@ import '#js/input/tex/dsfont/DsfontConfiguration'; /**********************************************************************************/ describe('Dsfont', () => { - beforeEach(() => setupTex(['base', 'dsfont'])); test('mathds', () => { expect(tex2mml('\\mathds{Aa}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Dsfont sans', () => { - - beforeEach(() => setupTex(['base', 'dsfont'], {dsfont: {sans: true}})); + beforeEach(() => setupTex(['base', 'dsfont'], { dsfont: { sans: true } })); test('mathds', () => { expect(tex2mml('\\mathds{Aa}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Empheq.test.ts b/testsuite/tests/input/tex/Empheq.test.ts index 26f18571f..21806b61e 100644 --- a/testsuite/tests/input/tex/Empheq.test.ts +++ b/testsuite/tests/input/tex/Empheq.test.ts @@ -4,51 +4,67 @@ import '#js/input/tex/empheq/EmpheqConfiguration'; import '#js/input/tex/cases/CasesConfiguration'; import '#js/input/tex/ams/AmsConfiguration'; -beforeEach(() => setupTex(['base', 'ams', 'empheq', 'cases'], {tags: 'ams'})); +beforeEach(() => setupTex(['base', 'ams', 'empheq', 'cases'], { tags: 'ams' })); /**********************************************************************************/ describe('Empheq', () => { - test('Empheq Left', () => { - expect(tex2mml('\\begin{empheq}[left=L\\Rightarrow]{align} a&=b\\\\ c&=d \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{empheq}[left=L\\Rightarrow]{align} a&=b\\\\ c&=d \\end{empheq}' + ) + ).toMatchSnapshot(); }); test('Empheq Right', () => { - expect(tex2mml('\\begin{empheq}[right=\\Leftarrow R]{align} a&=b\\\\ c&=d \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{empheq}[right=\\Leftarrow R]{align} a&=b\\\\ c&=d \\end{empheq}' + ) + ).toMatchSnapshot(); }); test('Numcases with label', () => { - expect(tex2mml('\\begin{numcases}{A=\\label{test}} a&=b \\end{numcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{numcases}{A=\\label{test}} a&=b \\end{numcases}') + ).toMatchSnapshot(); }); test('Numcases empty right', () => { - expect(tex2mml('\\begin{empheq}[right=x]{align} \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{empheq}[right=x]{align} \\end{empheq}') + ).toMatchSnapshot(); }); test('Numcases empty left', () => { - expect(tex2mml('\\begin{empheq}[left=x]{multline} \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{empheq}[left=x]{multline} \\end{empheq}') + ).toMatchSnapshot(); }); test('Numcases ', () => { - expect(tex2mml('\\begin{empheq}[right=x]{align} a \\\\ b&=c \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{empheq}[right=x]{align} a \\\\ b&=c \\end{empheq}') + ).toMatchSnapshot(); }); test('Numcases alignedat', () => { - expect(tex2mml('\\begin{empheq}{alignat=2} a & b & c & d \\end{empheq}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{empheq}{alignat=2} a & b & c & d \\end{empheq}') + ).toMatchSnapshot(); }); test('Numcases invalid env', () => { - expectTexError('\\begin{empheq}{split} \\end{empheq}') - .toBe('Invalid environment "split" for empheq'); + expectTexError('\\begin{empheq}{split} \\end{empheq}').toBe( + 'Invalid environment "split" for empheq' + ); }); - }); /**********************************************************************************/ describe('Empheq Characters', () => { - test('empheqlbrace', () => { expect(tex2mml('\\empheqlbrace')).toMatchSnapshot(); }); @@ -185,7 +201,7 @@ describe('Empheq Characters', () => { expect(tex2mml('\\empheql(')).toMatchSnapshot(); }); - test('empheqr',() => { + test('empheqr', () => { expect(tex2mml('\\empheqr)')).toMatchSnapshot(); }); @@ -196,7 +212,6 @@ describe('Empheq Characters', () => { test('empheqbigr', () => { expect(tex2mml('\\empheqbigr)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Enclose.test.ts b/testsuite/tests/input/tex/Enclose.test.ts index ac2ba39f6..cea780e60 100644 --- a/testsuite/tests/input/tex/Enclose.test.ts +++ b/testsuite/tests/input/tex/Enclose.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'enclose'])); /**********************************************************************************/ describe('Enclose', () => { - it('Enclose 1', () => { expect(tex2mml('\\enclose{updiagonalstrike}{x}')).toMatchSnapshot(); }); @@ -21,17 +20,22 @@ describe('Enclose', () => { }); it('Enclose Attr 2', () => { - expect(tex2mml('\\enclose{updiagonalarrow}[mathbackground=red]{x}')).toMatchSnapshot(); + expect( + tex2mml('\\enclose{updiagonalarrow}[mathbackground=red]{x}') + ).toMatchSnapshot(); }); it('Enclose Attr 1', () => { - expect(tex2mml('\\enclose{horizontalstrike}[data-thickness=5]{x}')).toMatchSnapshot(); + expect( + tex2mml('\\enclose{horizontalstrike}[data-thickness=5]{x}') + ).toMatchSnapshot(); }); it('Enclose Attrs', () => { - expect(tex2mml('\\enclose{circle}[data-thickness=10,data-padding=5]{x}')).toMatchSnapshot(); + expect( + tex2mml('\\enclose{circle}[data-thickness=10,data-padding=5]{x}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Extpfeil.test.ts b/testsuite/tests/input/tex/Extpfeil.test.ts index f8e81bcfa..34cc11c5f 100644 --- a/testsuite/tests/input/tex/Extpfeil.test.ts +++ b/testsuite/tests/input/tex/Extpfeil.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'extpfeil'])); /**********************************************************************************/ describe('Extpfeil', () => { - it('Xtwoheadrightarrow', () => { expect(tex2mml('\\xtwoheadrightarrow{abcxyz}')).toMatchSnapshot(); }); @@ -29,40 +28,44 @@ describe('Extpfeil', () => { }); it('Newextarrow', () => { - expect(tex2mml('\\Newextarrow{\\ab}{10,20}{8672}\\ab{xyz}')).toMatchSnapshot(); + expect( + tex2mml('\\Newextarrow{\\ab}{10,20}{8672}\\ab{xyz}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Extpfeil Errors', () => { - it('NewextarrowArg1', () => { - expectTexError('\\Newextarrow{ab}{10,20}{8672}\\ab{xyz}') - .toBe('First argument to \\Newextarrow must be a control sequence name'); + expectTexError('\\Newextarrow{ab}{10,20}{8672}\\ab{xyz}').toBe( + 'First argument to \\Newextarrow must be a control sequence name' + ); }); it('NewextarrowArg2 One', () => { - expectTexError('\\Newextarrow{\\ab}{10}{8672}\\ab{xyz}') - .toBe('Second argument to \\Newextarrow must be two integers separated by a comma'); + expectTexError('\\Newextarrow{\\ab}{10}{8672}\\ab{xyz}').toBe( + 'Second argument to \\Newextarrow must be two integers separated by a comma' + ); }); it('NewextarrowArg2 Two', () => { - expectTexError('\\Newextarrow{\\ab}{10 20}{8672}\\ab{xyz}') - .toBe('Second argument to \\Newextarrow must be two integers separated by a comma'); + expectTexError('\\Newextarrow{\\ab}{10 20}{8672}\\ab{xyz}').toBe( + 'Second argument to \\Newextarrow must be two integers separated by a comma' + ); }); it('NewextarrowArg2 Three', () => { - expectTexError('\\Newextarrow{\\ab}{aa}{8672}\\ab{xyz}') - .toBe('Second argument to \\Newextarrow must be two integers separated by a comma'); + expectTexError('\\Newextarrow{\\ab}{aa}{8672}\\ab{xyz}').toBe( + 'Second argument to \\Newextarrow must be two integers separated by a comma' + ); }); it('NewextarrowArg3', () => { - expectTexError('\\Newextarrow{\\ab}{10,20}{AG}\\ab{xyz}') - .toBe('Third argument to \\Newextarrow must be a unicode character number'); + expectTexError('\\Newextarrow{\\ab}{10,20}{AG}\\ab{xyz}').toBe( + 'Third argument to \\Newextarrow must be a unicode character number' + ); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Gensymb.test.ts b/testsuite/tests/input/tex/Gensymb.test.ts index dc9631b49..685634558 100644 --- a/testsuite/tests/input/tex/Gensymb.test.ts +++ b/testsuite/tests/input/tex/Gensymb.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'gensymb'])); /**********************************************************************************/ describe('Gensymb', () => { - test('ohm', () => { expect(tex2mml('\\ohm')).toMatchSnapshot(); }); @@ -27,7 +26,6 @@ describe('Gensymb', () => { test('micro', () => { expect(tex2mml('\\micro')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Html.test.ts b/testsuite/tests/input/tex/Html.test.ts index 83cd62403..a99ed2793 100644 --- a/testsuite/tests/input/tex/Html.test.ts +++ b/testsuite/tests/input/tex/Html.test.ts @@ -7,33 +7,44 @@ beforeEach(() => setupTex(['base', 'html'])); /**********************************************************************************/ describe('Html', () => { - it('Html Href Simple', () => { expect(tex2mml('\\href{https://mathjax.org}{a}')).toMatchSnapshot(); }); it('Html Href Complex', () => { - expect(tex2mml('\\href{https://mathjax.org}{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\href{https://mathjax.org}{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('Html Href Inner', () => { - expect(tex2mml('\\frac{a}{\\href{https://mathjax.org}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\frac{a}{\\href{https://mathjax.org}{b}}') + ).toMatchSnapshot(); }); it('Html Style Simple', () => { - expect(tex2mml('\\style{color:green;background-color:blue}{a}')).toMatchSnapshot(); + expect( + tex2mml('\\style{color:green;background-color:blue}{a}') + ).toMatchSnapshot(); }); it('Html Style Complex', () => { - expect(tex2mml('\\style{color:green;background-color:blue}{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\style{color:green;background-color:blue}{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('Html Style Inner', () => { - expect(tex2mml('\\frac{a}{\\style{color:green;background-color:blue}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\frac{a}{\\style{color:green;background-color:blue}{b}}') + ).toMatchSnapshot(); }); it('Html Style Nested', () => { - expect(tex2mml('\\style{color:red}{\\style{background:blue}{x}}')).toMatchSnapshot(); + expect( + tex2mml('\\style{color:red}{\\style{background:blue}{x}}') + ).toMatchSnapshot(); }); it('Html Style Row', () => { @@ -73,9 +84,10 @@ describe('Html', () => { }); it('Html Data Invalid', () => { - expectTexError('\\data{a/b=bar}{x}').toBe('Invalid HTML attribute: data-a/b'); + expectTexError('\\data{a/b=bar}{x}').toBe( + 'Invalid HTML attribute: data-a/b' + ); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Mathtools.test.ts b/testsuite/tests/input/tex/Mathtools.test.ts index 3b8b0a89e..9119cdb2a 100644 --- a/testsuite/tests/input/tex/Mathtools.test.ts +++ b/testsuite/tests/input/tex/Mathtools.test.ts @@ -1,5 +1,11 @@ import { afterAll, beforeEach, describe, expect, test } from '@jest/globals'; -import { getTokens, setupTex, tex2mml, expectTexError, trapErrors } from '#helpers'; +import { + getTokens, + setupTex, + tex2mml, + expectTexError, + trapErrors, +} from '#helpers'; import '#js/input/tex/mathtools/MathtoolsConfiguration'; import '#js/input/tex/ams/AmsConfiguration'; import '#js/input/tex/boldsymbol/BoldsymbolConfiguration'; @@ -14,21 +20,32 @@ beforeEach(() => setupTex(['base', 'ams', 'boldsymbol', 'mathtools'])); /**********************************************************************************/ describe('Mathtools Spacing Control', () => { - test('mathllap', () => { - expect(tex2mml('\\mathord{=}\\mathllap{x}\\quad \\mathord{=}\\mathllap[\\scriptstyle]{x}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathord{=}\\mathllap{x}\\quad \\mathord{=}\\mathllap[\\scriptstyle]{x}' + ) + ).toMatchSnapshot(); }); test('mathrlap', () => { - expect(tex2mml('\\mathrlap{x}\\mathord{=}\\quad \\mathrlap[\\scriptstyle]{x}\\mathord{=}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathrlap{x}\\mathord{=}\\quad \\mathrlap[\\scriptstyle]{x}\\mathord{=}' + ) + ).toMatchSnapshot(); }); test('mathclap', () => { - expect(tex2mml('X = \\sum_{\\mathclap{1\\le i\\le j\\le n}} X_{ij}')).toMatchSnapshot(); + expect( + tex2mml('X = \\sum_{\\mathclap{1\\le i\\le j\\le n}} X_{ij}') + ).toMatchSnapshot(); }); test('clap', () => { - expect(tex2mml('X = \\sum_{\\clap{long text under}} X_{ij}')).toMatchSnapshot(); + expect( + tex2mml('X = \\sum_{\\clap{long text under}} X_{ij}') + ).toMatchSnapshot(); }); test('mathmakebox', () => { @@ -60,7 +77,11 @@ describe('Mathtools Spacing Control', () => { }); test('cramped', () => { - expect(tex2mml('x^2\\cramped{x^2}\\quad{\\scriptstyle x^2}\\cramped[\\scriptstyle]{x^2}')).toMatchSnapshot(); + expect( + tex2mml( + 'x^2\\cramped{x^2}\\quad{\\scriptstyle x^2}\\cramped[\\scriptstyle]{x^2}' + ) + ).toMatchSnapshot(); }); test('crampedllap', () => { @@ -80,57 +101,72 @@ describe('Mathtools Spacing Control', () => { }); test('adjustlimits', () => { - expect(tex2mml('\\adjustlimits\\lim_{n\\to\\infty} \\max_{p^2\\ge n}')).toMatchSnapshot(); + expect( + tex2mml('\\adjustlimits\\lim_{n\\to\\infty} \\max_{p^2\\ge n}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Tagging', () => { - test('newtagform', () => { - expect(tex2mml('\\newtagform{brackets}{[}{]}\\usetagform{brackets} E=mc^2\\tag{1}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newtagform{brackets}{[}{]}\\usetagform{brackets} E=mc^2\\tag{1}' + ) + ).toMatchSnapshot(); }); test('newtagform styled', () => { - expect(tex2mml('\\newtagform{bfbrackets}[\\textbf]{[}{]}\\usetagform{bfbrackets} E=mc^2\\tag{1}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newtagform{bfbrackets}[\\textbf]{[}{]}\\usetagform{bfbrackets} E=mc^2\\tag{1}' + ) + ).toMatchSnapshot(); }); test('newtagform duplicate', () => { - expectTexError('\\newtagform{a}{(}{)}\\newtagform{a}{((}{))}') - .toBe('Duplicate tag form: a'); + expectTexError('\\newtagform{a}{(}{)}\\newtagform{a}{((}{))}').toBe( + 'Duplicate tag form: a' + ); }); test('newtagform empty name', () => { - expectTexError('\\newtagform{}{(}{)}') - .toBe("Tag form name can't be empty"); + expectTexError('\\newtagform{}{(}{)}').toBe("Tag form name can't be empty"); }); test('usetagform undefined name', () => { - expectTexError('\\usetagform{error}') - .toBe('Undefined tag form: error'); + expectTexError('\\usetagform{error}').toBe('Undefined tag form: error'); }); test('renewtagform', () => { - expect(tex2mml('\\newtagform{a}{(}{)}\\renewtagform{a}{((}{))}\\usetagform{a} E=mc^2\\tag{1}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newtagform{a}{(}{)}\\renewtagform{a}{((}{))}\\usetagform{a} E=mc^2\\tag{1}' + ) + ).toMatchSnapshot(); }); test('refeq', () => { - expect(tex2mml('\\begin{align}E=mc^2\\label{test}\\tag*{\\textsf{A}}\\\\ \\refeq{test}\\end{align}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{align}E=mc^2\\label{test}\\tag*{\\textsf{A}}\\\\ \\refeq{test}\\end{align}' + ) + ).toMatchSnapshot(); }); test('Tags add', () => { - setupTex(['base', 'ams', 'mathtools'], {tags: 'ams'}); - expect(tex2mml('\\newtagform{bars}||\\usetagform{bars} x\\tag{1}')).toMatchSnapshot(); + setupTex(['base', 'ams', 'mathtools'], { tags: 'ams' }); + expect( + tex2mml('\\newtagform{bars}||\\usetagform{bars} x\\tag{1}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Symbols', () => { - test('Delimiters', () => { expect(tex2mml('\\left\\lparen X \\right\\rparen')).toMatchSnapshot(); }); @@ -138,13 +174,11 @@ describe('Mathtools Symbols', () => { test('Other', () => { expect(tex2mml('\\ndownarrow \\nuparrow \\bigtimes_n')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools stretchy', () => { - test('xleftrightarrow', () => { expect(tex2mml('\\xleftrightarrow{x+y}')).toMatchSnapshot(); }); @@ -214,332 +248,499 @@ describe('Mathtools stretchy', () => { }); test('underbracket', () => { - expect(tex2mml('\\underbracket{x+y+z}_{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\underbracket{x+y+z}_{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('underbracket thickness', () => { - expect(tex2mml('\\underbracket[3px]{x+y+z}_{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\underbracket[3px]{x+y+z}_{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('underbracket height', () => { - expect(tex2mml('\\underbracket[][10px]{x+y+z}_{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\underbracket[][10px]{x+y+z}_{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('underbracket thickness height', () => { - expect(tex2mml('\\underbracket[3px][10px]{x+y+z}_{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\underbracket[3px][10px]{x+y+z}_{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('overbracket', () => { - expect(tex2mml('\\overbracket{x+y+z}^{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\overbracket{x+y+z}^{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('overbracket thickness', () => { - expect(tex2mml('\\overbracket[3px]{x+y+z}^{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\overbracket[3px]{x+y+z}^{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('overbracket height', () => { - expect(tex2mml('\\overbracket[][10px]{x+y+z}^{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\overbracket[][10px]{x+y+z}^{\\text{$n$ times}}') + ).toMatchSnapshot(); }); test('overbracket thickness height', () => { - expect(tex2mml('\\overbracket[3px][10px]{x+y+z}^{\\text{$n$ times}}')).toMatchSnapshot(); + expect( + tex2mml('\\overbracket[3px][10px]{x+y+z}^{\\text{$n$ times}}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Matrix Environments', () => { - test('matrix*', () => { - expect(tex2mml('\\begin{matrix*} -1 & 3 \\\\ 2 & -4 \\end{matrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{matrix*} -1 & 3 \\\\ 2 & -4 \\end{matrix*}') + ).toMatchSnapshot(); }); test('matrix*[l]', () => { - expect(tex2mml('\\begin{matrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{matrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{matrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{matrix*}') + ).toMatchSnapshot(); }); test('matrix*[c]', () => { - expect(tex2mml('\\begin{matrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{matrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{matrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{matrix*}') + ).toMatchSnapshot(); }); test('matrix*[r]', () => { - expect(tex2mml('\\begin{matrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{matrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{matrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{matrix*}') + ).toMatchSnapshot(); }); test('pmatrix*', () => { - expect(tex2mml('\\begin{pmatrix*} -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix*} -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}') + ).toMatchSnapshot(); }); test('pmatrix*[l]', () => { - expect(tex2mml('\\begin{pmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}') + ).toMatchSnapshot(); }); test('pmatrix*[c]', () => { - expect(tex2mml('\\begin{pmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}') + ).toMatchSnapshot(); }); test('pmatrix*[r]', () => { - expect(tex2mml('\\begin{pmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{pmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{pmatrix*}') + ).toMatchSnapshot(); }); test('bmatrix*', () => { - expect(tex2mml('\\begin{bmatrix*} -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bmatrix*} -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}') + ).toMatchSnapshot(); }); test('bmatrix*[l]', () => { - expect(tex2mml('\\begin{bmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}') + ).toMatchSnapshot(); }); test('bmatrix*[c]', () => { - expect(tex2mml('\\begin{bmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}') + ).toMatchSnapshot(); }); test('bmatrix*[r]', () => { - expect(tex2mml('\\begin{bmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{bmatrix*}') + ).toMatchSnapshot(); }); test('Bmatrix*', () => { - expect(tex2mml('\\begin{Bmatrix*} -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bmatrix*} -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}') + ).toMatchSnapshot(); }); test('Bmatrix*[l]', () => { - expect(tex2mml('\\begin{Bmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}') + ).toMatchSnapshot(); }); test('Bmatrix*[c]', () => { - expect(tex2mml('\\begin{Bmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}') + ).toMatchSnapshot(); }); test('Bmatrix*[r]', () => { - expect(tex2mml('\\begin{Bmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{Bmatrix*}') + ).toMatchSnapshot(); }); test('vmatrix*', () => { - expect(tex2mml('\\begin{vmatrix*} -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vmatrix*} -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}') + ).toMatchSnapshot(); }); test('vmatrix*[l]', () => { - expect(tex2mml('\\begin{vmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}') + ).toMatchSnapshot(); }); test('vmatrix*[c]', () => { - expect(tex2mml('\\begin{vmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}') + ).toMatchSnapshot(); }); test('vmatrix*[r]', () => { - expect(tex2mml('\\begin{vmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{vmatrix*}') + ).toMatchSnapshot(); }); test('Vmatrix*', () => { - expect(tex2mml('\\begin{Vmatrix*} -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vmatrix*} -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}') + ).toMatchSnapshot(); }); test('Vmatrix*[l]', () => { - expect(tex2mml('\\begin{Vmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vmatrix*}[l] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}') + ).toMatchSnapshot(); }); test('Vmatrix*[c]', () => { - expect(tex2mml('\\begin{Vmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vmatrix*}[c] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}') + ).toMatchSnapshot(); }); test('Vmatrix*[r]', () => { - expect(tex2mml('\\begin{Vmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vmatrix*}[r] -1 & 3 \\\\ 2 & -4 \\end{Vmatrix*}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Small Matrix Environments', () => { - test('smallmatrix*', () => { - expect(tex2mml('\\begin{smallmatrix*} -a & b \\\\ c & -d \\end{smallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix*} -a & b \\\\ c & -d \\end{smallmatrix*}') + ).toMatchSnapshot(); }); test('smallmatrix*[l]', () => { - expect(tex2mml('\\begin{smallmatrix*}[l] -a & b \\\\ c & -d \\end{smallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix*}[l] -a & b \\\\ c & -d \\end{smallmatrix*}') + ).toMatchSnapshot(); }); test('smallmatrix*[c]', () => { - expect(tex2mml('\\begin{smallmatrix*}[c] -a & b \\\\ c & -d \\end{smallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix*}[c] -a & b \\\\ c & -d \\end{smallmatrix*}') + ).toMatchSnapshot(); }); test('smallmatrix*[r]', () => { - expect(tex2mml('\\begin{smallmatrix*}[r] -a & b \\\\ c & -d \\end{smallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix*}[r] -a & b \\\\ c & -d \\end{smallmatrix*}') + ).toMatchSnapshot(); }); test('psmallmatrix*', () => { - expect(tex2mml('\\begin{psmallmatrix*} -a & b \\\\ c & -d \\end{psmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{psmallmatrix*} -a & b \\\\ c & -d \\end{psmallmatrix*}') + ).toMatchSnapshot(); }); test('psmallmatrix*[l]', () => { - expect(tex2mml('\\begin{psmallmatrix*}[l] -a & b \\\\ c & -d \\end{psmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{psmallmatrix*}[l] -a & b \\\\ c & -d \\end{psmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('psmallmatrix*[c]', () => { - expect(tex2mml('\\begin{psmallmatrix*}[c] -a & b \\\\ c & -d \\end{psmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{psmallmatrix*}[c] -a & b \\\\ c & -d \\end{psmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('psmallmatrix*[r]', () => { - expect(tex2mml('\\begin{psmallmatrix*}[r] -a & b \\\\ c & -d \\end{psmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{psmallmatrix*}[r] -a & b \\\\ c & -d \\end{psmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('bsmallmatrix*', () => { - expect(tex2mml('\\begin{bsmallmatrix*} -a & b \\\\ c & -d \\end{bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bsmallmatrix*} -a & b \\\\ c & -d \\end{bsmallmatrix*}') + ).toMatchSnapshot(); }); test('bsmallmatrix*[l]', () => { - expect(tex2mml('\\begin{bsmallmatrix*}[l] -a & b \\\\ c & -d \\end{bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{bsmallmatrix*}[l] -a & b \\\\ c & -d \\end{bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('bsmallmatrix*[c]', () => { - expect(tex2mml('\\begin{bsmallmatrix*}[c] -a & b \\\\ c & -d \\end{bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{bsmallmatrix*}[c] -a & b \\\\ c & -d \\end{bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('bsmallmatrix*[r]', () => { - expect(tex2mml('\\begin{bsmallmatrix*}[r] -a & b \\\\ c & -d \\end{bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{bsmallmatrix*}[r] -a & b \\\\ c & -d \\end{bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Bsmallmatrix*', () => { - expect(tex2mml('\\begin{Bsmallmatrix*} -a & b \\\\ c & -d \\end{Bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bsmallmatrix*} -a & b \\\\ c & -d \\end{Bsmallmatrix*}') + ).toMatchSnapshot(); }); test('Bsmallmatrix*[l]', () => { - expect(tex2mml('\\begin{Bsmallmatrix*}[l] -a & b \\\\ c & -d \\end{Bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Bsmallmatrix*}[l] -a & b \\\\ c & -d \\end{Bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Bsmallmatrix*[c]', () => { - expect(tex2mml('\\begin{Bsmallmatrix*}[c] -a & b \\\\ c & -d \\end{Bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Bsmallmatrix*}[c] -a & b \\\\ c & -d \\end{Bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Bsmallmatrix*[r]', () => { - expect(tex2mml('\\begin{Bsmallmatrix*}[r] -a & b \\\\ c & -d \\end{Bsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Bsmallmatrix*}[r] -a & b \\\\ c & -d \\end{Bsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('vsmallmatrix*', () => { - expect(tex2mml('\\begin{vsmallmatrix*} -a & b \\\\ c & -d \\end{vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vsmallmatrix*} -a & b \\\\ c & -d \\end{vsmallmatrix*}') + ).toMatchSnapshot(); }); test('vsmallmatrix*[l]', () => { - expect(tex2mml('\\begin{vsmallmatrix*}[l] -a & b \\\\ c & -d \\end{vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{vsmallmatrix*}[l] -a & b \\\\ c & -d \\end{vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('vsmallmatrix*[c]', () => { - expect(tex2mml('\\begin{vsmallmatrix*}[c] -a & b \\\\ c & -d \\end{vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{vsmallmatrix*}[c] -a & b \\\\ c & -d \\end{vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('vsmallmatrix*[r]', () => { - expect(tex2mml('\\begin{vsmallmatrix*}[r] -a & b \\\\ c & -d \\end{vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{vsmallmatrix*}[r] -a & b \\\\ c & -d \\end{vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Vsmallmatrix*', () => { - expect(tex2mml('\\begin{Vsmallmatrix*} -a & b \\\\ c & -d \\end{Vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vsmallmatrix*} -a & b \\\\ c & -d \\end{Vsmallmatrix*}') + ).toMatchSnapshot(); }); test('Vsmallmatrix*[l]', () => { - expect(tex2mml('\\begin{Vsmallmatrix*}[l] -a & b \\\\ c & -d \\end{Vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Vsmallmatrix*}[l] -a & b \\\\ c & -d \\end{Vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Vsmallmatrix*[c]', () => { - expect(tex2mml('\\begin{Vsmallmatrix*}[c] -a & b \\\\ c & -d \\end{Vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Vsmallmatrix*}[c] -a & b \\\\ c & -d \\end{Vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('Vsmallmatrix*[r]', () => { - expect(tex2mml('\\begin{Vsmallmatrix*}[r] -a & b \\\\ c & -d \\end{Vsmallmatrix*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{Vsmallmatrix*}[r] -a & b \\\\ c & -d \\end{Vsmallmatrix*}' + ) + ).toMatchSnapshot(); }); test('smallmatrix', () => { - expect(tex2mml('\\begin{smallmatrix} -a & b \\\\ c & -d \\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix} -a & b \\\\ c & -d \\end{smallmatrix}') + ).toMatchSnapshot(); }); test('smallmatrix', () => { - expect(tex2mml('\\begin{smallmatrix} -a & b \\\\ c & -d \\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix} -a & b \\\\ c & -d \\end{smallmatrix}') + ).toMatchSnapshot(); }); test('psmallmatrix', () => { - expect(tex2mml('\\begin{psmallmatrix} -a & b \\\\ c & -d \\end{psmallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{psmallmatrix} -a & b \\\\ c & -d \\end{psmallmatrix}') + ).toMatchSnapshot(); }); test('bsmallmatrix', () => { - expect(tex2mml('\\begin{bsmallmatrix} -a & b \\\\ c & -d \\end{bsmallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{bsmallmatrix} -a & b \\\\ c & -d \\end{bsmallmatrix}') + ).toMatchSnapshot(); }); test('Bsmallmatrix', () => { - expect(tex2mml('\\begin{Bsmallmatrix} -a & b \\\\ c & -d \\end{Bsmallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Bsmallmatrix} -a & b \\\\ c & -d \\end{Bsmallmatrix}') + ).toMatchSnapshot(); }); test('vsmallmatrix', () => { - expect(tex2mml('\\begin{vsmallmatrix} -a & b \\\\ c & -d \\end{vsmallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{vsmallmatrix} -a & b \\\\ c & -d \\end{vsmallmatrix}') + ).toMatchSnapshot(); }); test('Vsmallmatrix', () => { - expect(tex2mml('\\begin{Vsmallmatrix} -a & b \\\\ c & -d \\end{Vsmallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{Vsmallmatrix} -a & b \\\\ c & -d \\end{Vsmallmatrix}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools More Environments', () => { - test('multlined', () => { - expect(tex2mml( + expect( + tex2mml( 'A = \\begin{multlined}[t]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined} B' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined [b] width', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{multlined}[b][7cm]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined} = B' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined [c] width', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{multlined}[c][7cm]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined} = B' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined [t] width', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{multlined}[t][7cm]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined} = B' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined width', () => { - expect(tex2mml('\\begin{multlined}[7cm]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{multlined}[7cm]\\framebox[4cm]{first}\\\\\\framebox[4cm]{last}\\end{multlined}' + ) + ).toMatchSnapshot(); }); test('multlined shoved', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{multlined}[c][7cm]', '\\framebox[4cm]{first} \\\\', '\\shoveright{\\framebox[4cm]{second}} \\\\', '\\shoveleft{\\framebox[4cm]{third}} \\\\', '\\framebox[4cm]{last}', - '\\end{multlined}' + '\\end{multlined}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined shoved distance', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{multlined}[c][7cm]', '\\framebox[4cm]{first} \\\\', '\\shoveright[1cm]{\\framebox[4cm]{second}} \\\\', '\\shoveleft[1cm]{\\framebox[4cm]{third}} \\\\', '\\framebox[4cm]{last}', - '\\end{multlined}' + '\\end{multlined}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('shoved outside multline', () => { - expectTexError('\\shoveleft') - .toBe('\\shoveleft can only appear within the multline or multlined environments'); + expectTexError('\\shoveleft').toBe( + '\\shoveleft can only appear within the multline or multlined environments' + ); }); test('multlined shoved misplaced', () => { @@ -547,85 +748,111 @@ describe('Mathtools More Environments', () => { [ '\\begin{multlined}[c][7cm]', '\\framebox[4cm]{first}\\shoveleft \\\\', - '\\end{multlined}' + '\\end{multlined}', ].join('') ).toBe('\\shoveleft must come at the beginning of the line'); }); test('multlined bad width', () => { - expectTexError('\\begin{multlined}[abc] \\end{multlined}') - .toBe('Width for \\begin{multlined} must be a dimension'); + expectTexError('\\begin{multlined}[abc] \\end{multlined}').toBe( + 'Width for \\begin{multlined} must be a dimension' + ); }); test('multlined empty row', () => { - expect(tex2mml('\\begin{multlined} a \\\\ \\end{multlined}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{multlined} a \\\\ \\end{multlined}') + ).toMatchSnapshot(); }); test('dcases', () => { - expect(tex2mml('\\begin{dcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{dcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{dcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{dcases}') + ).toMatchSnapshot(); }); test('dcases*', () => { - expect(tex2mml('\\begin{dcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{dcases*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{dcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{dcases*}' + ) + ).toMatchSnapshot(); }); test('rcases', () => { - expect(tex2mml('\\begin{rcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{rcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{rcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{rcases}') + ).toMatchSnapshot(); }); test('rcases*', () => { - expect(tex2mml('\\begin{rcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{rcases*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{rcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{rcases*}' + ) + ).toMatchSnapshot(); }); test('drcases', () => { - expect(tex2mml('\\begin{drcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{drcases}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{drcases} 1 & x>0 \\\\ -1 & x\\le 0 \\end{drcases}') + ).toMatchSnapshot(); }); test('drcases*', () => { - expect(tex2mml('\\begin{drcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{drcases*}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{drcases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{drcases*}' + ) + ).toMatchSnapshot(); }); test('cases*', () => { - expect(tex2mml('\\begin{cases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{cases*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{cases*} 1 & if $x>0$ \\\\ -1 & otherwise \\end{cases*}') + ).toMatchSnapshot(); }); test('MoveEqLeft', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{align*}', '\\MoveEqLeft \\framebox[10cm][c]{Long first line} \\\\', ' & = \\framebox[6cm][c]{ \\vphantom{g} 2nd line} \\\\', ' & \\leq \\dots', - '\\end{align*}' + '\\end{align*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('Spreadlines', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{spreadlines}{20pt}', '\\begin{gather}', 'a=b\\\\', 'c=d', '\\end{gather}', - '\\end{spreadlines}' + '\\end{spreadlines}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('Spreadlines no environment', () => { - expect(tex2mml( - [ - '\\begin{spreadlines}{20pt}', - 'a=b', - '\\end{spreadlines}' - ].join('') - )).toMatchSnapshot(); + expect( + tex2mml( + ['\\begin{spreadlines}{20pt}', 'a=b', '\\end{spreadlines}'].join('') + ) + ).toMatchSnapshot(); }); test('Spreadlines multiple environments', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{spreadlines}{20pt}', '\\begin{gather}', @@ -637,55 +864,67 @@ describe('Mathtools More Environments', () => { 'x=y\\\\', 'z', '\\end{gather}', - '\\end{spreadlines}' + '\\end{spreadlines}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('lgathered', () => { - expect(tex2mml('\\begin{lgathered} a+b+c \\\\ d \\end{lgathered}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{lgathered} a+b+c \\\\ d \\end{lgathered}') + ).toMatchSnapshot(); }); test('rgathered', () => { - expect(tex2mml('\\begin{rgathered} a+b+c \\\\ d \\end{rgathered}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{rgathered} a+b+c \\\\ d \\end{rgathered}') + ).toMatchSnapshot(); }); test('ArrowBetweenLines', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{alignat*}{2}', '&& \\framebox[1.5cm]{} &= \\framebox[3cm]{} \\\\', '\\ArrowBetweenLines', '&& \\framebox[1.5cm]{} &= \\framebox[2cm]{}', - '\\end{alignat*}' + '\\end{alignat*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('ArrowBetweenLines*', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{alignat*}{2}', '&& \\framebox[1.5cm]{} &= \\framebox[3cm]{} &&\\\\', '\\ArrowBetweenLines*[\\Downarrow]', '&& \\framebox[1.5cm]{} &= \\framebox[2cm]{} &&', - '\\end{alignat*}' + '\\end{alignat*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('ArrowBetweenLines misplaced', () => { - expectTexError('\\begin{aligned} a \\ArrowBetweenLines \\end{aligned}') - .toBe('\\ArrowBetweenLines must be on a row by itself'); + expectTexError( + '\\begin{aligned} a \\ArrowBetweenLines \\end{aligned}' + ).toBe('\\ArrowBetweenLines must be on a row by itself'); }); test('ArrowBetweenLines error', () => { - expectTexError('\\ArrowBetweenLines') - .toBe('\\ArrowBetweenLines can only be used in aligment environments'); + expectTexError('\\ArrowBetweenLines').toBe( + '\\ArrowBetweenLines can only be used in aligment environments' + ); }); test('vdotswithin smallvdotswithin', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{align*}', 'a &= b \\\\', @@ -693,25 +932,29 @@ describe('Mathtools More Environments', () => { '& = c \\\\', '\\shortvdotswithin{=}', '& = d', - '\\end{align*}' + '\\end{align*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('smallvdotswithin star', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{aligned}', 'A&+ B \\\\', '&\\shortvdotswithin*{+}', 'C &+ D', - '\\end{aligned}' + '\\end{aligned}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('vdotswithin smallvdotswithin', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\begin{alignat*}{3}', 'A&+ B &&= C &&+ D \\\\', @@ -719,103 +962,133 @@ describe('Mathtools More Environments', () => { '&\\vdotswithin{+} &&&& \\vdotswithin{+}', '\\MTFlushSpaceBelow ', 'C &+ D &&= Y &&+K', - '\\end{alignat*}' + '\\end{alignat*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Paired Delimiters', () => { - test('DeclarePairedDelimiter', () => { - expect(tex2mml('\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs{\\frac{a}{b}}' + ) + ).toMatchSnapshot(); }); test('DeclarePairedDelimiter star', () => { - expect(tex2mml('\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs*{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs*{\\frac{a}{b}}' + ) + ).toMatchSnapshot(); }); test('DeclarePairedDelimiter size', () => { - expect(tex2mml('\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs[\\Bigg]{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\abs[\\Bigg]{\\frac{a}{b}}' + ) + ).toMatchSnapshot(); }); test('DeclarePairedDelimiter duplicate', () => { - expectTexError('\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\DeclarePairedDelimiter\\abs{|}{|}') - .toBe('Command \\abs already defined'); + expectTexError( + '\\DeclarePairedDelimiter\\abs{\\lvert}{\\rvert} \\DeclarePairedDelimiter\\abs{|}{|}' + ).toBe('Command \\abs already defined'); }); test('DeclarePairedDelimiterX', () => { - expect(tex2mml('\\DeclarePairedDelimiterX\\x[1]{\\lvert}{\\rvert}{a#1b} \\x{X}')).toMatchSnapshot(); + expect( + tex2mml('\\DeclarePairedDelimiterX\\x[1]{\\lvert}{\\rvert}{a#1b} \\x{X}') + ).toMatchSnapshot(); }); test('DeclarePairedDelimiterXPP', () => { - expect(tex2mml('\\DeclarePairedDelimiterXPP\\x[1]{A}{\\lvert}{\\rvert}{B}{a#1b} \\x{X}')).toMatchSnapshot(); + expect( + tex2mml( + '\\DeclarePairedDelimiterXPP\\x[1]{A}{\\lvert}{\\rvert}{B}{a#1b} \\x{X}' + ) + ).toMatchSnapshot(); }); test('DeclarePairedDelimiters Backward Compatibility', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\DeclarePairedDelimiters\\a{|}{|}', '\\DeclarePairedDelimitersX\\b[1]{|}{|}{#1}', '\\DeclarePairedDelimitersXPP\\c[1]{A}{|}{|}{B}{#1}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Boxed Equations', () => { - test('Aboxed', () => { - expect(tex2mml('\\begin{align*}\\Aboxed{ a & = b} \\\\ & = c \\end{align*}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{align*}\\Aboxed{ a & = b} \\\\ & = c \\end{align*}') + ).toMatchSnapshot(); }); test('Aboxed error', () => { - expectTexError('\\Aboxed{ a & = b}') - .toBe('\\Aboxed can only be used in aligment environments'); + expectTexError('\\Aboxed{ a & = b}').toBe( + '\\Aboxed can only be used in aligment environments' + ); }); test('Aboxed odd column', () => { - expect(tex2mml('\\begin{aligned} & \\Aboxed{ a & = b} \\end{aligned}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{aligned} & \\Aboxed{ a & = b} \\end{aligned}') + ).toMatchSnapshot(); }); test('MakeAboxedCommand', () => { - expect(tex2mml('\\MakeAboxedCommand\\Afbox\\fbox \\begin{align}\\Afbox{a &= b}\\end{align}')).toMatchSnapshot(); + expect( + tex2mml( + '\\MakeAboxedCommand\\Afbox\\fbox \\begin{align}\\Afbox{a &= b}\\end{align}' + ) + ).toMatchSnapshot(); }); test('MakeAboxedCommand star', () => { setupTex(['base', 'ams', 'newcommand', 'bbox', 'mathtools']); - expect(tex2mml( + expect( + tex2mml( '\\def\\mybox#1{\\bbox[yellow, 5px, border:2px solid]{#1}}\\MakeAboxedCommand*\\Afbox\\mybox \\begin{align}\\Afbox{a &= b}\\end{align}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('MakeAboxedCommand no cs', () => { - expectTexError('\\MakeAboxedCommand x') - .toBe('\\MakeAboxedCommand must be followed by a control sequence'); + expectTexError('\\MakeAboxedCommand x').toBe( + '\\MakeAboxedCommand must be followed by a control sequence' + ); }); test('MakeAboxedCommand no box', () => { - expectTexError('\\MakeAboxedCommand\\x x') - .toBe('\\MakeAboxedCommand\\x must be followed by a control sequence'); + expectTexError('\\MakeAboxedCommand\\x x').toBe( + '\\MakeAboxedCommand\\x must be followed by a control sequence' + ); }); test('MakeAboxedCommand redefined', () => { - expectTexError('\\MakeAboxedCommand*\\x\\boxed \\MakeAboxedCommand\\x\\fbox') - .toBe('\\x is already defined'); + expectTexError( + '\\MakeAboxedCommand*\\x\\boxed \\MakeAboxedCommand\\x\\fbox' + ).toBe('\\x is already defined'); }); - }); /**********************************************************************************/ describe('Mathtools Centered Colons', () => { - test(':=', () => { expect(tex2mml('a := b')).toMatchSnapshot(); }); @@ -911,13 +1184,11 @@ describe('Mathtools Centered Colons', () => { test('Dashcolon', () => { expect(tex2mml('a \\Dashcolon b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Prescripts', () => { - test('prescripts sub sup', () => { expect(tex2mml('\\prescript{a}{b}{X}^{c}_{d}')).toMatchSnapshot(); }); @@ -953,27 +1224,31 @@ describe('Mathtools Prescripts', () => { test('prescript filter ingores others', () => { expect(tex2mml('\\sideset{^a}{C}{_b}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools Split Fractions', () => { - test('splitfrac', () => { - expect(tex2mml('\\frac{\\splitfrac{x + y}{+ x + y}}{z}=\\frac{\\splitdfrac{x + y}{+ x + y}}{z}')).toMatchSnapshot(); + expect( + tex2mml( + '\\frac{\\splitfrac{x + y}{+ x + y}}{z}=\\frac{\\splitdfrac{x + y}{+ x + y}}{z}' + ) + ).toMatchSnapshot(); }); test('splitfrac nested', () => { - expect(tex2mml('\\frac{\\splitfrac{x + x + z}{\\splitfrac{\\mathstrut x + y + z}{+ x + y + z}}}{z}')).toMatchSnapshot(); + expect( + tex2mml( + '\\frac{\\splitfrac{x + x + z}{\\splitfrac{\\mathstrut x + y + z}{+ x + y + z}}}{z}' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools struts', () => { - test('xmathstrut', () => { expect(tex2mml('\\xmathstrut{0.1}')).toMatchSnapshot(); }); @@ -983,153 +1258,185 @@ describe('Mathtools struts', () => { }); test('xmathstrut error', () => { - expectTexError('\\xmathstrut{abc}') - .toBe('Argument to \\xmathstrut is not a number'); + expectTexError('\\xmathstrut{abc}').toBe( + 'Argument to \\xmathstrut is not a number' + ); }); - }); /**********************************************************************************/ describe('Mathtools setoptions', () => { - test('multlined gap and pos', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{multlined-gap=2em,multlined-pos=b}', - 'a+\\begin{multlined} a \\\\ b \\end{multlined}+b' + 'a+\\begin{multlined} a \\\\ b \\end{multlined}+b', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined-pos override', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{multlined-gap=2em,multlined-pos=b}', - 'a+\\begin{multlined}[b] a \\\\ b \\end{multlined}+b' + 'a+\\begin{multlined}[b] a \\\\ b \\end{multlined}+b', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined skips', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{multlined-gap=2em,firstline-afterskip=3em,lastline-preskip=1em}', - '\\begin{multlined}[b] a \\\\ b \\end{multlined}' + '\\begin{multlined}[b] a \\\\ b \\end{multlined}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('multlined width', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{multlined-width=5em}', - '\\begin{multlined} a \\\\ b \\end{multlined}' + '\\begin{multlined} a \\\\ b \\end{multlined}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('smallmatrix-align', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{smallmatrix-align=r}', - '\\begin{psmallmatrix*} a \\\\ -b \\end{psmallmatrix*}' + '\\begin{psmallmatrix*} a \\\\ -b \\end{psmallmatrix*}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('contercolon', () => { - expect(tex2mml('\\mathtoolsset{centercolon=true} a := b')).toMatchSnapshot(); + expect( + tex2mml('\\mathtoolsset{centercolon=true} a := b') + ).toMatchSnapshot(); }); test('contercolon-offset', () => { - expect(tex2mml('\\mathtoolsset{centercolon-offset=.6em} a \\vcentercolon= b')).toMatchSnapshot(); + expect( + tex2mml('\\mathtoolsset{centercolon-offset=.6em} a \\vcentercolon= b') + ).toMatchSnapshot(); }); test('thincolor dx and dw', () => { - expect(tex2mml('\\mathtoolsset{thincolon-dx=-.06em,thincolon-dw=.12em} a \\coloneq b')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathtoolsset{thincolon-dx=-.06em,thincolon-dw=.12em} a \\coloneq b' + ) + ).toMatchSnapshot(); }); test('use-unicode', () => { - expect(tex2mml( + expect( + tex2mml( '\\mathtoolsset{use-unicode=true}\\coloneq\\Coloneqq\\coloneq\\Coloneqq\\eqqcolon\\eqcolon\\dblcolon\\dashcolon' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); test('prescript formats', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\mathtoolsset{prescript-sub-format=\\mathbf,prescript-sup-format=\\mathsf}', '\\mathtoolsset{prescript-arg-format=\\mathfrak}', - '\\prescript{a}{b}{X}^{c}_{d}' + '\\prescript{a}{b}{X}^{c}_{d}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mathtools options', () => { - beforeEach(() => {}); test('setoptions', () => { - setupTex(['base', 'mathtools'], {mathtools: {'allow-mathtoolsset': false}}); - expectTexError('\\mathtoolsset{use-unicode=true}') - .toBe('\\mathtoolsset is disabled'); + setupTex(['base', 'mathtools'], { + mathtools: { 'allow-mathtoolsset': false }, + }); + expectTexError('\\mathtoolsset{use-unicode=true}').toBe( + '\\mathtoolsset is disabled' + ); }); test('tagforms', () => { setupTex(['base', 'ams', 'mathtools'], { mathtools: { tagforms: { - bold: ['[[', ']]', '\\mathbf'] - } - } + bold: ['[[', ']]', '\\mathbf'], + }, + }, }); expect(tex2mml('\\usetagform{bold} a=b\\tag{x}')).toMatchSnapshot(); }); test('tagforms error', () => { - expect(trapErrors(() => { - setupTex(['base', 'ams', 'mathtools'], { - mathtools: { - tagforms: { - bold: ['[[', ']]', '\\mathbf', 'error'] - } - } - }); - })).toBe('The tag form definition for "bold" should be an array of three strings'); + expect( + trapErrors(() => { + setupTex(['base', 'ams', 'mathtools'], { + mathtools: { + tagforms: { + bold: ['[[', ']]', '\\mathbf', 'error'], + }, + }, + }); + }) + ).toBe( + 'The tag form definition for "bold" should be an array of three strings' + ); }); test('tagforms reset', () => { setupTex(['base', 'ams', 'mathtools'], { mathtools: { tagforms: { - bold: ['[[', ']]', '\\mathbf'] - } - } + bold: ['[[', ']]', '\\mathbf'], + }, + }, }); - expect(tex2mml('\\usetagform{bold} \\usetagform{} a\\tag{1}')).toMatchSnapshot(); + expect( + tex2mml('\\usetagform{bold} \\usetagform{} a\\tag{1}') + ).toMatchSnapshot(); }); test('non-ams tags', () => { class myTags extends AbstractTags { - formatTag(tag: string) {return ['[[', tag, ']]']} - }; + formatTag(tag: string) { + return ['[[', tag, ']]']; + } + } Configuration.create('mytags', { - [ConfigurationType.TAGS]: {mytags: myTags}, + [ConfigurationType.TAGS]: { mytags: myTags }, [ConfigurationType.CONFIG]: (config: any, jax: any) => { jax.parseOptions.options.tags = 'mytags'; jax.constructor.tags(jax.parseOptions, config); - } + }, }); - setupTex(['base', 'ams', 'mathtools', ['mytags', 10]], {tags: 'ams'}); - expectTexError('\\newtagform{a}()') - .toBe('\\newtagform can only be used with ams or mathtools tags'); - expectTexError('\\usetagform{bold}') - .toBe('\\usetagform can only be used with ams or mathtools tags'); + setupTex(['base', 'ams', 'mathtools', ['mytags', 10]], { tags: 'ams' }); + expectTexError('\\newtagform{a}()').toBe( + '\\newtagform can only be used with ams or mathtools tags' + ); + expectTexError('\\usetagform{bold}').toBe( + '\\usetagform can only be used with ams or mathtools tags' + ); }); test('pairedDelimiters', () => { @@ -1139,8 +1446,8 @@ describe('Mathtools options', () => { aaa: ['[', ']'], bbb: ['|', '|', '[#1]', 1], ccc: ['\\{', '\\}', '[#1]', 1, '\\Rightarrow', '\\Leftarrow'], - } - } + }, + }, }); expect(tex2mml('\\aaa{x} \\aaa*{x} \\aaa[\\bigg]{x}')).toMatchSnapshot(); expect(tex2mml('\\bbb{x} \\bbb*{x} \\bbb[\\bigg]{x}')).toMatchSnapshot(); @@ -1149,20 +1456,33 @@ describe('Mathtools options', () => { test('mathtoolsset', () => { setupTex(['base', 'ams', 'mathtools']); - expect(tex2mml('\\mathtoolsset{multlined-pos={}}\\begin{multlined} a \\end{multlined}')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathtoolsset{multlined-pos={}}\\begin{multlined} a \\end{multlined}' + ) + ).toMatchSnapshot(); }); test('mathtoolsset legacycolonsymbols', () => { setupTex(['base', 'ams', 'mathtools']); - expect(tex2mml('\\mathtoolsset{legacycolonsymbols}\\coloneq\\Coloneq\\eqcolon\\Eqcolon')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathtoolsset{legacycolonsymbols}\\coloneq\\Coloneq\\eqcolon\\Eqcolon' + ) + ).toMatchSnapshot(); }); test('legacycolonsymbols option', () => { - setupTex(['base', 'ams', 'mathtools'], {mathtools: {legacycolonsymbols: true}}); + setupTex(['base', 'ams', 'mathtools'], { + mathtools: { legacycolonsymbols: true }, + }); expect(tex2mml('\\coloneq\\Coloneq\\eqcolon\\Eqcolon')).toMatchSnapshot(); - expect(tex2mml('\\mathtoolsset{legacycolonsymbols=false}\\coloneq\\Coloneq\\eqcolon\\Eqcolon')).toMatchSnapshot(); + expect( + tex2mml( + '\\mathtoolsset{legacycolonsymbols=false}\\coloneq\\Coloneq\\eqcolon\\Eqcolon' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Mhchem.test.ts b/testsuite/tests/input/tex/Mhchem.test.ts index c9546884e..46571c44d 100644 --- a/testsuite/tests/input/tex/Mhchem.test.ts +++ b/testsuite/tests/input/tex/Mhchem.test.ts @@ -8,13 +8,14 @@ beforeEach(() => setupTex(['base', 'mhchem'])); /**********************************************************************************/ describe('Mhchem0', () => { - it('Chem-1', () => { expect(tex2mml('\\ce{CO2 + C -> 2 CO}')).toMatchSnapshot(); }); it('Chem-3', () => { - expect(tex2mml('C_p[\\ce{H2O(l)}] = \\pu{75.3 J // mol K}')).toMatchSnapshot(); + expect( + tex2mml('C_p[\\ce{H2O(l)}] = \\pu{75.3 J // mol K}') + ).toMatchSnapshot(); }); it('Chem-4', () => { @@ -40,13 +41,11 @@ describe('Mhchem0', () => { it('Chem-9', () => { expect(tex2mml('\\ce{Y^99+}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem1', () => { - it('Chem-10', () => { expect(tex2mml('\\ce{Y^{99+}}')).toMatchSnapshot(); }); @@ -86,13 +85,11 @@ describe('Mhchem1', () => { it('Chem-19', () => { expect(tex2mml('\\ce{^{0}_{-1}n^{-}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem2', () => { - it('Chem-20', () => { expect(tex2mml('\\ce{^0_-1n-}')).toMatchSnapshot(); }); @@ -132,13 +129,11 @@ describe('Mhchem2', () => { it('Chem-29', () => { expect(tex2mml('\\ce{A <<=> B}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem3', () => { - it('Chem-33', () => { expect(tex2mml('\\ce{(NH4)2S}')).toMatchSnapshot(); }); @@ -148,7 +143,9 @@ describe('Mhchem3', () => { }); it('Chem-35', () => { - expect(tex2mml('\\ce{CH4 + 2 $\\left( \\ce{O2 + 79/21 N2} \\right)$}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{CH4 + 2 $\\left( \\ce{O2 + 79/21 N2} \\right)$}') + ).toMatchSnapshot(); }); it('Chem-36', () => { @@ -166,13 +163,11 @@ describe('Mhchem3', () => { it('Chem-39', () => { expect(tex2mml('\\ce{ZnS($c$)}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem4', () => { - it('Chem-40', () => { expect(tex2mml('\\ce{ZnS(\\ca$c$)}')).toMatchSnapshot(); }); @@ -208,13 +203,11 @@ describe('Mhchem4', () => { it('Chem-49', () => { expect(tex2mml('\\ce{Fe(CN)_{$\\frac{6}{2}$}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem5', () => { - it('Chem-50', () => { expect(tex2mml('\\ce{X_{$i$}^{$x$}}')).toMatchSnapshot(); }); @@ -254,13 +247,11 @@ describe('Mhchem5', () => { it('Chem-59', () => { expect(tex2mml('\\ce{A\\bond{-}B\\bond{=}C\\bond{#}D}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem6', () => { - it('Chem-60', () => { expect(tex2mml('\\ce{A\\bond{1}B\\bond{2}C\\bond{3}D}')).toMatchSnapshot(); }); @@ -270,7 +261,9 @@ describe('Mhchem6', () => { }); it('Chem-62', () => { - expect(tex2mml('\\ce{A\\bond{~--}B\\bond{~=}C\\bond{-~-}D}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{A\\bond{~--}B\\bond{~=}C\\bond{-~-}D}') + ).toMatchSnapshot(); }); it('Chem-63', () => { @@ -300,13 +293,11 @@ describe('Mhchem6', () => { it('Chem-69', () => { expect(tex2mml('\\ce{OCO^{.-}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem7', () => { - it('Chem-70', () => { expect(tex2mml('\\ce{NO^{(2.)-}}')).toMatchSnapshot(); }); @@ -346,13 +337,11 @@ describe('Mhchem7', () => { it('Chem-79', () => { expect(tex2mml('\\ce{SO4^2- + Ba^2+ -> BaSO4 v}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem8', () => { - it('Chem-80', () => { expect(tex2mml('\\ce{A v B (v) -> B ^ B (^)}')).toMatchSnapshot(); }); @@ -386,23 +375,27 @@ describe('Mhchem8', () => { }); it('Chem-88', () => { - expect(tex2mml( + expect( + tex2mml( '\\ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\\underset{\\text{amphoteres Hydroxid}}{\\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\\underset{\\text{Hydroxozikat}}{\\ce{[Zn(OH)4]^2-}}$}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Chem-89', () => { - expect(tex2mml('\\ce{$K = \\frac{[\\ce{Hg^2+}][\\ce{Hg}]}{[\\ce{Hg2^2+}]}$}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{$K = \\frac{[\\ce{Hg^2+}][\\ce{Hg}]}{[\\ce{Hg2^2+}]}$}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Mhchem9', () => { - it('Chem-90', () => { - expect(tex2mml('\\ce{$K = \\ce{\\frac{[Hg^2+][Hg]}{[Hg2^2+]}}$}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{$K = \\ce{\\frac{[Hg^2+][Hg]}{[Hg2^2+]}}$}') + ).toMatchSnapshot(); }); it('Chem-92', () => { @@ -452,7 +445,6 @@ describe('Mhchem9', () => { it('Chem-103', () => { expect(tex2mml('\\pu{1,2E3 kJ}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -461,7 +453,9 @@ describe('Mhchem-Ams', () => { beforeEach(() => setupTex(['base', 'ams', 'mhchem'])); it('Chem-2', () => { - expect(tex2mml('\\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}') + ).toMatchSnapshot(); }); it('Chem-30', () => { @@ -469,7 +463,9 @@ describe('Mhchem-Ams', () => { }); it('Chem-31', () => { - expect(tex2mml('\\ce{A ->[{text above}][{text below}] B}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{A ->[{text above}][{text below}] B}') + ).toMatchSnapshot(); }); it('Chem-32', () => { @@ -477,18 +473,21 @@ describe('Mhchem-Ams', () => { }); it('Chem-43', () => { - expect(tex2mml('\\ce{x Na(NH4)HPO4 ->[\\Delta] (NaPO3)_x + x NH3 ^ + x H2O}')).toMatchSnapshot(); + expect( + tex2mml('\\ce{x Na(NH4)HPO4 ->[\\Delta] (NaPO3)_x + x NH3 ^ + x H2O}') + ).toMatchSnapshot(); }); it('Chem-91', () => { - expect(tex2mml( + expect( + tex2mml( '\\ce{Hg^2+ ->[I-] $\\underset{\\mathrm{red}}{\\ce{HgI2}}$ ->[I-] $\\underset{\\mathrm{red}}{\\ce{[Hg^{II}I4]^2-}}$}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Mhchem Error', () => { - expectTexError('\\ce{A\\bond{x}B}') - .toBe('mhchem bug T. Please report.'); + expectTexError('\\ce{A\\bond{x}B}').toBe('mhchem bug T. Please report.'); }); it('Mhchem stretchy <-', () => { @@ -526,7 +525,6 @@ describe('Mhchem-Ams', () => { it('Mhchem rightleftharpoons', () => { expect(tex2mml('\\ce{A\\rightleftharpoons B}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Newcommand.test.ts b/testsuite/tests/input/tex/Newcommand.test.ts index ea10dc238..3835857b3 100644 --- a/testsuite/tests/input/tex/Newcommand.test.ts +++ b/testsuite/tests/input/tex/Newcommand.test.ts @@ -14,45 +14,61 @@ describe('Newcommand', () => { }); it('Newcommand Arg', () => { - expect(tex2mml('\\renewcommand{\\sum}[1]{2 #1 3}\\sum{*}')).toMatchSnapshot(); + expect( + tex2mml('\\renewcommand{\\sum}[1]{2 #1 3}\\sum{*}') + ).toMatchSnapshot(); }); it('Newcommand Optional', () => { - expect(tex2mml('\\renewcommand{\\sum}[1][+]{2 #1 3}\\sum\\sum[*]')).toMatchSnapshot(); + expect( + tex2mml('\\renewcommand{\\sum}[1][+]{2 #1 3}\\sum\\sum[*]') + ).toMatchSnapshot(); }); it('Newcommand Arg Optional', () => { - expect(tex2mml('\\renewcommand{\\sum}[2][+]{2 #1 3 #2 4}\\sum{+}\\sum[*]{+}')).toMatchSnapshot(); + expect( + tex2mml('\\renewcommand{\\sum}[2][+]{2 #1 3 #2 4}\\sum{+}\\sum[*]{+}') + ).toMatchSnapshot(); }); it('Newenvironment Optional', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{argument}[1][a]{\\textbf{Argument #1:}}{aa}\\begin{argument}[c]b\\end{argument}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Optional Noarg', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{argument}[1][a]{\\textbf{Argument #1:}}{aa}\\begin{argument}b\\end{argument}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Arg Optional', () => { - expect(tex2mml( + expect( + tex2mml( '\\renewenvironment{argument}[2][a]{\\textbf{Argument #1(#2):}}{aa}\\begin{argument}[c]{3}b\\end{argument}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Def Double Let', () => { - expect(tex2mml( + expect( + tex2mml( '\\def\\bar{h}\\let\\fooi\\bar\\def\\fooii{\\bar}\\fooi +\\fooii\\def\\bar{g}\\fooi +\\fooii' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Def ReDef', () => { - expect(tex2mml( + expect( + tex2mml( '\\def\\foo{a + b}\\foo\\def\\foo#1{a #1 b}\\foo{-}\\def\\foo#1#2{#2 #1 b}\\foo{-}{x}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Brace Equal', () => { @@ -76,35 +92,49 @@ describe('Newcommand', () => { }); it('Let Relet', () => { - expect(tex2mml('\\let\\al\\alpha\\al\\alpha\\let\\al\\aleph\\al\\alpha')).toMatchSnapshot(); + expect( + tex2mml('\\let\\al\\alpha\\al\\alpha\\let\\al\\aleph\\al\\alpha') + ).toMatchSnapshot(); }); it('Let Let', () => { - expect(tex2mml('\\let\\al\\alpha\\al\\alpha\\let\\alpha\\beta\\al\\alpha')).toMatchSnapshot(); + expect( + tex2mml('\\let\\al\\alpha\\al\\alpha\\let\\alpha\\beta\\al\\alpha') + ).toMatchSnapshot(); }); it('Def Let', () => { - expect(tex2mml('\\def\\bar[#1]#2{#1 + #2}\\bar[a]{b}\\let\\foo\\bar\\foo[c]{d}')).toMatchSnapshot(); + expect( + tex2mml('\\def\\bar[#1]#2{#1 + #2}\\bar[a]{b}\\let\\foo\\bar\\foo[c]{d}') + ).toMatchSnapshot(); }); it('Newcommand Let', () => { - expect(tex2mml( + expect( + tex2mml( '\\newcommand{\\bar}[2][1]{#1 + #2}\\bar[a]{b}\\let\\foo\\bar\\foo[c]{d}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Circular Macro', () => { - expect(tex2mml( + expect( + tex2mml( '\\let\\kk\\alpha\\kk\\let\\rr\\beta\\rr\\let\\rr\\kk\\let\\kk\\beta\\kk\\rr' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Brace Equal Stretchy', () => { - expect(tex2mml('\\let\\lb=\\{\\left\\lb \\frac{1}{2} \\right\\}')).toMatchSnapshot(); + expect( + tex2mml('\\let\\lb=\\{\\left\\lb \\frac{1}{2} \\right\\}') + ).toMatchSnapshot(); }); it('Let Paren Stretchy', () => { - expect(tex2mml('\\let\\lb( \\left\\lb \\frac{1}{2} \\right)')).toMatchSnapshot(); + expect( + tex2mml('\\let\\lb( \\left\\lb \\frac{1}{2} \\right)') + ).toMatchSnapshot(); }); it('Let Fn', () => { @@ -112,36 +142,45 @@ describe('Newcommand', () => { }); it('Let Fn Double', () => { - expect(tex2mml('\\let\\ll\\sin\\ll(x)\\let\\rr\\ll\\let\\ll\\cos\\rr(x)\\ll(x)')).toMatchSnapshot(); + expect( + tex2mml('\\let\\ll\\sin\\ll(x)\\let\\rr\\ll\\let\\ll\\cos\\rr(x)\\ll(x)') + ).toMatchSnapshot(); }); it('Let Fn Circular', () => { - expect(tex2mml( + expect( + tex2mml( '\\let\\save\\sin\\let\\sin\\cos\\let\\cos\\tan\\let\\tan\\save\\sin(x)\\cos(x)\\tan(x)' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Paren Circular', () => { - expect(tex2mml( + expect( + tex2mml( '\\let\\lp(\\let\\rp)\\let\\mp\\rp\\left\\lp \\frac{a}{b}\\middle\\mp c \\right\\rp' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Angle Circular', () => { - expect(tex2mml( + expect( + tex2mml( '\\let\\lp\\langle\\let\\rp\\rangle\\let\\mp\\rp\\left\\lp \\frac{a}{b}\\middle\\mp c \\right\\rp' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Circular Character', () => { - expect(tex2mml( + expect( + tex2mml( '\\let\\a a\\let\\b b\\a \\b\\let\\c\\a\\let\\a c\\c \\a\\let\\d=\\c\\let\\c\\b\\d \\c' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Let Self', () => { - expectTexError('\\let\\x\\x \\x') - .toBe('Undefined control sequence \\x'); + expectTexError('\\let\\x\\x \\x').toBe('Undefined control sequence \\x'); }); it('Let Overwrite Sqrt Choose', () => { @@ -153,25 +192,36 @@ describe('Newcommand', () => { }); it('Def Options CS', () => { - expect(tex2mml('\\def\\bar[#1]#2{#1 + #2}\\bar[\\sqrt{2}]{b}')).toMatchSnapshot(); + expect( + tex2mml('\\def\\bar[#1]#2{#1 + #2}\\bar[\\sqrt{2}]{b}') + ).toMatchSnapshot(); }); it('Def Template Matching', () => { - expect(tex2mml('\\def\\ending{+}\\def\\test#1\\end{[#1]} \\test a\\ending b\\end')).toMatchSnapshot(); + expect( + tex2mml( + '\\def\\ending{+}\\def\\test#1\\end{[#1]} \\test a\\ending b\\end' + ) + ).toMatchSnapshot(); }); it('Def Template Brace Removal', () => { - expect(tex2mml('\\def\\test#1\\end{\\text{#1}} \\test{a b}\\end')).toMatchSnapshot(); + expect( + tex2mml('\\def\\test#1\\end{\\text{#1}} \\test{a b}\\end') + ).toMatchSnapshot(); }); it('Def Template Brace Retention', () => { - expect(tex2mml('\\def\\test#1\\end{\\text{#1}} \\test{a}{b}\\end')).toMatchSnapshot(); + expect( + tex2mml('\\def\\test#1\\end{\\text{#1}} \\test{a}{b}\\end') + ).toMatchSnapshot(); }); it('Def Hash Replacement', () => { - expect(tex2mml('\\def\\x#1{\\def\\y##1#1{[##1]}\\y} \\x\\X abc \\X')).toMatchSnapshot(); + expect( + tex2mml('\\def\\x#1{\\def\\y##1#1{[##1]}\\y} \\x\\X abc \\X') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -180,48 +230,58 @@ describe('Newcommand Color v2', () => { beforeEach(() => setupTex(['base', 'newcommand', 'colorv2'])); it('Newenvironment Empty', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\begin{myHeartEnv}\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Content', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\begin{myHeartEnv} 2+3\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Nested Double', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\end{yourHeartEnv}\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Nested Double 2', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\newenvironment{theirHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\end{yourHeartEnv}\\begin{theirHeartEnv}b\\end{theirHeartEnv}\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Nested Triple', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\newenvironment{theirHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\begin{theirHeartEnv}b\\end{theirHeartEnv}\\end{yourHeartEnv}\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Nested Triple Text', () => { - expect(tex2mml( + expect( + tex2mml( '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\newenvironment{theirHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\begin{theirHeartEnv}b\\end{theirHeartEnv}c\\end{yourHeartEnv}d\\end{myHeartEnv}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Newenvironment Nested Error', () => { expectTexError( - '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\newenvironment{theirHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\begin{theirHeartEnv}b\\end{yourHeartEnv}\\end{theirHeartEnv}\\end{myHeartEnv}' - ) - .toBe('\\begin{theirHeartEnv} ended with \\end{yourHeartEnv}'); + '\\newenvironment{myHeartEnv}{\\color{purple}{\\heartsuit}\\kern-2.5pt\\color{green}{\\heartsuit}}{\\text{ forever}}\\newenvironment{yourHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\newenvironment{theirHeartEnv}{\\color{blue}{\\heartsuit}\\kern-2.5pt\\color{black}{\\heartsuit}}{\\text{ never}}\\begin{myHeartEnv}\\begin{yourHeartEnv}a\\begin{theirHeartEnv}b\\end{yourHeartEnv}\\end{theirHeartEnv}\\end{myHeartEnv}' + ).toBe('\\begin{theirHeartEnv} ended with \\end{yourHeartEnv}'); }); - }); /**********************************************************************************/ @@ -248,13 +308,16 @@ describe('Newcommand Ams', () => { }); it('Let Bar', () => { - expect(tex2mml('\\let\\b\\lvert\\let\\lvert\\langle\\vert\\b\\lvert')).toMatchSnapshot(); + expect( + tex2mml('\\let\\b\\lvert\\let\\lvert\\langle\\vert\\b\\lvert') + ).toMatchSnapshot(); }); it('Let Bar Stretchy', () => { - expect(tex2mml('\\let\\b\\lvert\\let\\lvert\\langle\\left\\b q \\right\\lvert')).toMatchSnapshot(); + expect( + tex2mml('\\let\\b\\lvert\\let\\lvert\\langle\\left\\b q \\right\\lvert') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -263,95 +326,114 @@ describe('NewcommandError', () => { beforeEach(() => setupTex(['base', 'newcommand'])); it('No Sequence', () => { - expectTexError('\\def\\bar[#1]#3{}') - .toBe('Parameters for \\bar must be numbered sequentially'); + expectTexError('\\def\\bar[#1]#3{}').toBe( + 'Parameters for \\bar must be numbered sequentially' + ); }); it('No CS', () => { - expectTexError('\\def{\\bar}[#1]#2{}') - .toBe('\\def must be followed by a control sequence'); + expectTexError('\\def{\\bar}[#1]#2{}').toBe( + '\\def must be followed by a control sequence' + ); }); it('Illegal Hash', () => { - expectTexError('\\def\\bar[##1]#2{#1}') - .toBe('Illegal use of # in template for \\bar'); + expectTexError('\\def\\bar[##1]#2{#1}').toBe( + 'Illegal use of # in template for \\bar' + ); }); it('No Replacement', () => { - expectTexError('\\def\\bar[#1]#2') - .toBe('Missing replacement string for definition of \\def'); + expectTexError('\\def\\bar[#1]#2').toBe( + 'Missing replacement string for definition of \\def' + ); }); it('Runaway Argument', () => { - expectTexError('\\def\\bar[#1]#2{}\\bar[') - .toBe('Runaway argument for \\bar?'); + expectTexError('\\def\\bar[#1]#2{}\\bar[').toBe( + 'Runaway argument for \\bar?' + ); }); it('Illegal CS', () => { - expectTexError('\\newcommand{\\11}{a}') - .toBe('Illegal control sequence name for \\newcommand'); + expectTexError('\\newcommand{\\11}{a}').toBe( + 'Illegal control sequence name for \\newcommand' + ); }); it('Illegal Parameter Number', () => { - expectTexError('\\newenvironment{hh}[a]{}{}') - .toBe('Illegal number of parameters specified in \\newenvironment'); + expectTexError('\\newenvironment{hh}[a]{}{}').toBe( + 'Illegal number of parameters specified in \\newenvironment' + ); }); it('Let Undefined CS', () => { - expectTexError('\\let\\aa\\bb \\aa') - .toBe('Undefined control sequence \\aa'); + expectTexError('\\let\\aa\\bb \\aa').toBe( + 'Undefined control sequence \\aa' + ); }); it('Missing Arguments', () => { - expectTexError('\\def\\bar[#1]#2#3{c + c}\\bar') - .toBe('Use of \\bar doesn\'t match its definition'); + expectTexError('\\def\\bar[#1]#2#3{c + c}\\bar').toBe( + "Use of \\bar doesn't match its definition" + ); }); it('Single Let Error', () => { - expectTexError('\\let\\aa\\textbf\\let\\bb\\aa\\aa') - .toBe('Missing argument for \\aa'); + expectTexError('\\let\\aa\\textbf\\let\\bb\\aa\\aa').toBe( + 'Missing argument for \\aa' + ); }); it('Double Let Error', () => { - expectTexError('\\let\\aa\\textbf\\let\\bb\\aa\\bb') - .toBe('Missing argument for \\bb'); + expectTexError('\\let\\aa\\textbf\\let\\bb\\aa\\bb').toBe( + 'Missing argument for \\bb' + ); }); it('Triple Let Error', () => { - expectTexError('\\let\\aa\\textbf\\let\\bb\\aa\\let\\textbf\\sqrt\\textbf[1]') - .toBe('Missing argument for \\textbf'); + expectTexError( + '\\let\\aa\\textbf\\let\\bb\\aa\\let\\textbf\\sqrt\\textbf[1]' + ).toBe('Missing argument for \\textbf'); }); it('Illegal Argument Number', () => { - expectTexError('\\newcommand{\\foo}[a]{#1 + #2}') - .toBe('Illegal number of parameters specified in \\newcommand'); + expectTexError('\\newcommand{\\foo}[a]{#1 + #2}').toBe( + 'Illegal number of parameters specified in \\newcommand' + ); }); it('Optional Brace Error', () => { - expectTexError('\\def\\bar[{#1}]#2{#1 + #2}') - .toBe("You can't use 'macro parameter character #' in math mode"); + expectTexError('\\def\\bar[{#1}]#2{#1 + #2}').toBe( + "You can't use 'macro parameter character #' in math mode" + ); }); it('Missing End Error', () => { - expectTexError('\\newenvironment{env}{aa}{bb}\\begin{env}cc') - .toBe('Missing \\end{env}'); + expectTexError('\\newenvironment{env}{aa}{bb}\\begin{env}cc').toBe( + 'Missing \\end{env}' + ); }); it('Hash Error', () => { - expectTexError('\\def\\x#1{a #1 b #c} \\x{a}') - .toBe('Illegal macro parameter reference'); + expectTexError('\\def\\x#1{a #1 b #c} \\x{a}').toBe( + 'Illegal macro parameter reference' + ); }); it('Recursive Macro', () => { - expectTexError('\\def\\x{\\x} \\x') - .toBe('MathJax maximum macro substitution count exceeded; is here a recursive macro call?'); + expectTexError('\\def\\x{\\x} \\x').toBe( + 'MathJax maximum macro substitution count exceeded; is here a recursive macro call?' + ); }); it('Recursive Environment', () => { - expectTexError('\\newenvironment{error}{\\begin{error}}{\\end{error}} \\begin{error}\\end{error}') - .toBe('MathJax maximum substitution count exceeded; is there a recursive latex environment?'); + expectTexError( + '\\newenvironment{error}{\\begin{error}}{\\end{error}} \\begin{error}\\end{error}' + ).toBe( + 'MathJax maximum substitution count exceeded; is there a recursive latex environment?' + ); }); - }); /**********************************************************************************/ @@ -360,28 +442,33 @@ describe('Newcommand Overrides', () => { beforeEach(() => setupTex(['base', 'newcommand'])); it('Let def macro be undefined', () => { - expectTexError('\\def\\test{error} \\let\\test=\\undefined \\test') - .toBe('Undefined control sequence \\test'); + expectTexError('\\def\\test{error} \\let\\test=\\undefined \\test').toBe( + 'Undefined control sequence \\test' + ); }); it('Let existing macro be undefined', () => { - expectTexError('\\let\\sqrt=\\undefined \\sqrt{x}') - .toBe('Undefined control sequence \\sqrt'); + expectTexError('\\let\\sqrt=\\undefined \\sqrt{x}').toBe( + 'Undefined control sequence \\sqrt' + ); }); it('Let existing delimiter be undefined', () => { - expectTexError('\\let\\|=\\undefined \\left\\| X \\right\\|') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError('\\let\\|=\\undefined \\left\\| X \\right\\|').toBe( + 'Missing or unrecognized delimiter for \\left' + ); }); it('Let after def of existing macro be undefined', () => { - expectTexError('\\def\\sqrt{X} \\let\\sqrt=\\undefined \\sqrt{x}') - .toBe('Undefined control sequence \\sqrt'); + expectTexError('\\def\\sqrt{X} \\let\\sqrt=\\undefined \\sqrt{x}').toBe( + 'Undefined control sequence \\sqrt' + ); }); it('Def overrides let delimiter', () => { - expectTexError('\\let\\test=\\| \\def\\test{x} \\left\\test X \\right\\test') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError( + '\\let\\test=\\| \\def\\test{x} \\left\\test X \\right\\test' + ).toBe('Missing or unrecognized delimiter for \\left'); }); it('Def overrides let delimiter as macro', () => { @@ -389,8 +476,9 @@ describe('Newcommand Overrides', () => { }); it('Def overrides existing delimiter', () => { - expectTexError('\\def\\|{x} \\left\\| X \\right\\|') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError('\\def\\|{x} \\left\\| X \\right\\|').toBe( + 'Missing or unrecognized delimiter for \\left' + ); }); it('Def overrides existing delimiter as macro', () => { @@ -398,11 +486,15 @@ describe('Newcommand Overrides', () => { }); it('Let overrides def macro', () => { - expect(tex2mml('\\def\\test{x} \\let\\test=\\| \\test X \\test')).toMatchSnapshot(); + expect( + tex2mml('\\def\\test{x} \\let\\test=\\| \\test X \\test') + ).toMatchSnapshot(); }); it('Let overrides def macro as delimiter', () => { - expect(tex2mml('\\def\\test{x} \\let\\test=\\| \\left\\test X \\right\\test')).toMatchSnapshot(); + expect( + tex2mml('\\def\\test{x} \\let\\test=\\| \\left\\test X \\right\\test') + ).toMatchSnapshot(); }); it('Let overrides existing macro', () => { @@ -410,12 +502,15 @@ describe('Newcommand Overrides', () => { }); it('Let overrides existing macro as delimiter', () => { - expect(tex2mml('\\let\\sqrt=\\| \\left\\sqrt X \\right\\sqrt')).toMatchSnapshot(); + expect( + tex2mml('\\let\\sqrt=\\| \\left\\sqrt X \\right\\sqrt') + ).toMatchSnapshot(); }); it('Let overrides delimiter', () => { - expectTexError('\\let\\|=\\sqrt \\left\\| X \\right\\|') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError('\\let\\|=\\sqrt \\left\\| X \\right\\|').toBe( + 'Missing or unrecognized delimiter for \\left' + ); }); it('Let overrides delimiter as macro', () => { @@ -423,18 +518,20 @@ describe('Newcommand Overrides', () => { }); it('Let of character macro overrides delimiter', () => { - expectTexError('\\let\\|=\\alpha \\left\\| X \\right\\|') - .toBe('Missing or unrecognized delimiter for \\left'); + expectTexError('\\let\\|=\\alpha \\left\\| X \\right\\|').toBe( + 'Missing or unrecognized delimiter for \\left' + ); }); it('Let of character creates delimiter', () => { - expect(tex2mml('\\let\\test=< \\left\\test X \\right\\test')).toMatchSnapshot(); + expect( + tex2mml('\\let\\test=< \\left\\test X \\right\\test') + ).toMatchSnapshot(); }); it('Let of character overrides def', () => { expect(tex2mml('\\def\\test{X}\\let\\test=< \\test')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -443,46 +540,57 @@ describe('Nested Environments', () => { beforeEach(() => setupTex(['base', 'ams', 'newcommand'])); it('Newenvironment with Begin', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\newenvironment{boxed}{\\begin{array}{|c|c|}\\hline}{\\\\\\hline\\end{array}}', - '\\begin{boxed}a&b\\\\c&d\\end{boxed}' + '\\begin{boxed}a&b\\\\c&d\\end{boxed}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Environments Nested', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\newenvironment{boxed}{\\begin{array}{|c|c|}\\hline}{\\\\\\hline\\end{array}}', - '\\begin{boxed}\\begin{boxed}a&b\\\\c&d\\end{boxed} & X \\\end{boxed}' + '\\begin{boxed}\\begin{boxed}a&b\\\\c&d\\end{boxed} & X \\\end{boxed}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Environments Intermixed', () => { - expect(tex2mml( + expect( + tex2mml( [ '\\newenvironment{a}{\\begin{b}}{\\end{b}}', '\\newenvironment{b}{x}{y}', - '\\begin{a} ... \\end{b}\\begin{b}\\end{a}' + '\\begin{a} ... \\end{b}\\begin{b}\\end{a}', ].join('') - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Nested Begins', () => { - expect(tex2mml('\\newenvironment{a}{x}{y}\\newenvironment{b}{p}{q}\\begin{a}\\begin{b}X\\end{b}\\end{a}')).toMatchSnapshot(); + expect( + tex2mml( + '\\newenvironment{a}{x}{y}\\newenvironment{b}{p}{q}\\begin{a}\\begin{b}X\\end{b}\\end{a}' + ) + ).toMatchSnapshot(); }); it('Dangling End', () => { - expectTexError('\\newenvironment{a}{x}{y\\end{a}}\\begin{a} ... \\end{a}') - .toBe('Missing \\begin{a} or extra \\end{a}'); + expectTexError( + '\\newenvironment{a}{x}{y\\end{a}}\\begin{a} ... \\end{a}' + ).toBe('Missing \\begin{a} or extra \\end{a}'); }); it('Nested Dangling End', () => { expectTexError( - '\\newenvironment{a}{\\begin{b}}{\\end{b}}\\newenvironment{b}{x}{y\\end{b}}\\begin{a}X\\end{a}') - .toBe('\\begin{a} ended with \\end{b}'); + '\\newenvironment{a}{\\begin{b}}{\\end{b}}\\newenvironment{b}{x}{y\\end{b}}\\begin{a}X\\end{a}' + ).toBe('\\begin{a} ended with \\end{b}'); }); it('Badly Nested Begins', () => { @@ -492,8 +600,9 @@ describe('Nested Environments', () => { }); it('Ended by Wrong Environment', () => { - expectTexError('\\newenvironment{a}{x}{y}\\begin{a} X \\end{cases}') - .toBe('\\begin{a} ended with \\end{cases}'); + expectTexError('\\newenvironment{a}{x}{y}\\begin{a} X \\end{cases}').toBe( + '\\begin{a} ended with \\end{cases}' + ); }); it('Unbalanced Ends 1', () => { @@ -514,11 +623,10 @@ describe('Nested Environments', () => { '\\newenvironment{c}{x}{\\end{a}y}', '\\newenvironment{b}{begin{c}x}{\\end{c}y}', '\\newenvironment{a}{\\begin{b}x}{\\end{b}y}', - '\\begin{a} ... ' + '\\begin{a} ... ', ].join('') ).toBe('Missing \\end{b}'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Noerrors.test.ts b/testsuite/tests/input/tex/Noerrors.test.ts index 50eb1f46b..bc61db8d2 100644 --- a/testsuite/tests/input/tex/Noerrors.test.ts +++ b/testsuite/tests/input/tex/Noerrors.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'noerrors'])); /**********************************************************************************/ describe('NoError', () => { - it('Ampersand-error', () => { expect(tex2mml('&')).toMatchSnapshot(); }); @@ -73,7 +72,9 @@ describe('NoError', () => { }); it('Multiple Move Root', () => { - expect(tex2mml('\\sqrt[\\uproot{-2}\\uproot{2}\\beta]{k}')).toMatchSnapshot(); + expect( + tex2mml('\\sqrt[\\uproot{-2}\\uproot{2}\\beta]{k}') + ).toMatchSnapshot(); }); it('Incorrect Move Root', () => { @@ -193,9 +194,11 @@ describe('NoError', () => { }); it('ErroneousNestingEq', () => { - expect(tex2mml( + expect( + tex2mml( '\\begin{equation}\\begin{eqnarray}\\end{eqnarray}\\end{equation}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('ExtraAlignTab', () => { @@ -233,7 +236,6 @@ describe('NoError', () => { it('EnvMissingEnd Equation', () => { expect(tex2mml('\\begin{equation}a')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Noundefined.test.ts b/testsuite/tests/input/tex/Noundefined.test.ts index 6da319cdb..04d4e34ee 100644 --- a/testsuite/tests/input/tex/Noundefined.test.ts +++ b/testsuite/tests/input/tex/Noundefined.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'noundefined'])); /**********************************************************************************/ describe('Noundefined', () => { - it('Noundefined Single', () => { expect(tex2mml('\\a')).toMatchSnapshot(); }); @@ -15,7 +14,6 @@ describe('Noundefined', () => { it('Noundefined Context', () => { expect(tex2mml('a\\b c')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Physics.test.ts b/testsuite/tests/input/tex/Physics.test.ts index 2e843e0a7..f95ea9cc5 100644 --- a/testsuite/tests/input/tex/Physics.test.ts +++ b/testsuite/tests/input/tex/Physics.test.ts @@ -2,13 +2,11 @@ import { afterAll, beforeEach, describe, expect, it } from '@jest/globals'; import { getTokens, setupTex, tex2mml, expectTexError } from '#helpers'; import '#js/input/tex/physics/PhysicsConfiguration'; - beforeEach(() => setupTex(['base', 'physics'])); /**********************************************************************************/ describe('Physics1_0', () => { - it('Quantities_Quantities_0', () => { expect(tex2mml('\\quantity')).toMatchSnapshot(); }); @@ -18,8 +16,9 @@ describe('Physics1_0', () => { }); it('Quantities_Quantities_2', () => { - expectTexError('\\quantity\\bigg a') - .toBe('Missing or unrecognized delimiter for \\bigg'); + expectTexError('\\quantity\\bigg a').toBe( + 'Missing or unrecognized delimiter for \\bigg' + ); }); it('Quantities_Quantities_3', () => { @@ -31,13 +30,15 @@ describe('Physics1_0', () => { }); it('Quantities_Quantities_5', () => { - expectTexError('\\qty\\Bigg ab') - .toBe('Missing or unrecognized delimiter for \\Bigg'); + expectTexError('\\qty\\Bigg ab').toBe( + 'Missing or unrecognized delimiter for \\Bigg' + ); }); it('Quantities_Quantities_6', () => { - expectTexError('\\quantity\\bigg\\sin') - .toBe('Missing or unrecognized delimiter for \\bigg'); + expectTexError('\\quantity\\bigg\\sin').toBe( + 'Missing or unrecognized delimiter for \\bigg' + ); }); it('Quantities_Quantities_7', () => { @@ -55,13 +56,11 @@ describe('Physics1_0', () => { it('Quantities_Quantities_10', () => { expect(tex2mml('\\qty\\Bigg{a}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_1', () => { - it('Quantities_Empty_0', () => { expect(tex2mml('\\qty\\big{}[]')).toMatchSnapshot(); }); @@ -105,13 +104,11 @@ describe('Physics1_1', () => { it('Quantities_Empty_10', () => { expect(tex2mml('\\qty<\\frac{a}{b}>\\langle\\rangle')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_2', () => { - it('Quantities_Big_0', () => { expect(tex2mml('\\quantity\\big(\\frac{a}{b})')).toMatchSnapshot(); }); @@ -159,13 +156,11 @@ describe('Physics1_2', () => { it('Quantities_Big_11', () => { expect(tex2mml('\\quantity*\\Bigg(\\frac{a}{b})')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_3', () => { - it('Quantities_Absval_0', () => { expect(tex2mml('\\absolutevalue\\Bigg{\\frac{a}{b}}')).toMatchSnapshot(); }); @@ -193,13 +188,11 @@ describe('Physics1_3', () => { it('Quantities_Absval_6', () => { expect(tex2mml('\\norm{}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_4', () => { - it('Quantities_Eval_0', () => { expect(tex2mml('\\evaluated{x}_0^\\infty')).toMatchSnapshot(); }); @@ -221,39 +214,49 @@ describe('Physics1_4', () => { }); it('Quantities_Eval_5', () => { - expect(tex2mml('\\eval*{\\frac{A}{\\frac{A}{\\int x}}}_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval*{\\frac{A}{\\frac{A}{\\int x}}}_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_6', () => { - expect(tex2mml('\\eval{\\frac{A}{\\frac{A}{\\int x}}}_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval{\\frac{A}{\\frac{A}{\\int x}}}_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_7', () => { - expect(tex2mml('\\eval*(\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval*(\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_8', () => { - expect(tex2mml('\\eval(\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval(\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_9', () => { - expect(tex2mml('\\eval*[\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval*[\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_10', () => { - expect(tex2mml('\\eval[\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty')).toMatchSnapshot(); + expect( + tex2mml('\\eval[\\frac{A}{\\frac{A}{\\int x}}|_0^\\infty') + ).toMatchSnapshot(); }); it('Quantities_Eval_11', () => { expect(tex2mml('\\eval_0^\\infty')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_5', () => { - it('Quantities_Order_0', () => { expect(tex2mml('\\order{}')).toMatchSnapshot(); }); @@ -271,21 +274,23 @@ describe('Physics1_5', () => { }); it('Quantities_Order_4', () => { - expect(tex2mml('\\order*{\\frac{A}{\\frac{A}{\\int x}}}')).toMatchSnapshot(); + expect( + tex2mml('\\order*{\\frac{A}{\\frac{A}{\\int x}}}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_6', () => { - it('Quantities_Comm_0', () => { expect(tex2mml('\\comm{A}{B}')).toMatchSnapshot(); }); it('Quantities_Comm_1', () => { - expect(tex2mml('\\comm{\\frac{A}{\\frac{A}{\\int x}}}{B}')).toMatchSnapshot(); + expect( + tex2mml('\\comm{\\frac{A}{\\frac{A}{\\int x}}}{B}') + ).toMatchSnapshot(); }); it('Quantities_Comm_2', () => { @@ -293,7 +298,9 @@ describe('Physics1_6', () => { }); it('Quantities_Comm_3', () => { - expect(tex2mml('\\comm*{\\frac{A}{\\frac{A}{\\int x}}}{B}')).toMatchSnapshot(); + expect( + tex2mml('\\comm*{\\frac{A}{\\frac{A}{\\int x}}}{B}') + ).toMatchSnapshot(); }); it('Quantities_Comm_4', () => { @@ -303,13 +310,11 @@ describe('Physics1_6', () => { it('Quantities_Comm_5', () => { expect(tex2mml('\\comm{A}B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics1_7', () => { - it('Quantities_Acomm_0', () => { expect(tex2mml('\\acomm{A}{B}')).toMatchSnapshot(); }); @@ -327,7 +332,9 @@ describe('Physics1_7', () => { }); it('Quantities_Acomm_4', () => { - expect(tex2mml('\\acomm{\\frac{A}{\\frac{A}{\\int x}}}{B}')).toMatchSnapshot(); + expect( + tex2mml('\\acomm{\\frac{A}{\\frac{A}{\\int x}}}{B}') + ).toMatchSnapshot(); }); it('Quantities_Acomm_5', () => { @@ -335,19 +342,19 @@ describe('Physics1_7', () => { }); it('Quantities_Acomm_6', () => { - expect(tex2mml('\\acomm*{\\frac{A}{\\frac{A}{\\int x}}}{B}')).toMatchSnapshot(); + expect( + tex2mml('\\acomm*{\\frac{A}{\\frac{A}{\\int x}}}{B}') + ).toMatchSnapshot(); }); it('Quantities_Acomm_7', () => { expect(tex2mml('\\acomm{A}B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_0', () => { - it('Vector_Bold_0', () => { expect(tex2mml('\\vectorbold{a}')).toMatchSnapshot(); }); @@ -373,9 +380,11 @@ describe('Physics2_0', () => { }); it('Vector_Bold_6', () => { - expect(tex2mml( + expect( + tex2mml( '\\vb{\\theta\\Gamma a\\delta \\frac{\\theta}{b}}\\frac{\\theta}{b}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Vector_Bold_7', () => { @@ -393,13 +402,11 @@ describe('Physics2_0', () => { it('Vector_Bold_10', () => { expect(tex2mml('\\vb*{\\theta}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_1', () => { - it('Vector_Special_0', () => { expect(tex2mml('\\vb{\\mbox{ab}}')).toMatchSnapshot(); }); @@ -451,13 +458,11 @@ describe('Physics2_1', () => { it('Vector_Special_12', () => { expect(tex2mml('\\vb{\\hat{=}}\\hat{=}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_2', () => { - it('Vector_Arrow_0', () => { expect(tex2mml('\\va{=}')).toMatchSnapshot(); }); @@ -483,9 +488,11 @@ describe('Physics2_2', () => { }); it('Vector_Arrow_6', () => { - expect(tex2mml( + expect( + tex2mml( '\\va{\\theta\\Gamma a\\delta \\frac{\\theta}{b}}\\frac{\\theta}{b}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Vector_Arrow_7', () => { @@ -511,13 +518,11 @@ describe('Physics2_2', () => { it('Vector_Arrow_12', () => { expect(tex2mml('\\va{a}\\vec{a}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_3', () => { - it('Vector_Unit_0', () => { expect(tex2mml('\\vu{=}')).toMatchSnapshot(); }); @@ -543,9 +548,11 @@ describe('Physics2_3', () => { }); it('Vector_Unit_6', () => { - expect(tex2mml( + expect( + tex2mml( '\\vu{\\theta\\Gamma a\\delta \\frac{\\theta}{b}}\\frac{\\theta}{b}' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Vector_Unit_7', () => { @@ -571,13 +578,11 @@ describe('Physics2_3', () => { it('Vector_Unit_12', () => { expect(tex2mml('\\vu{a}\\hat{a}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_4', () => { - it('Vector_Gradient_0', () => { expect(tex2mml('\\gradient ')).toMatchSnapshot(); }); @@ -609,13 +614,11 @@ describe('Physics2_4', () => { it('Vector_Gradient_7', () => { expect(tex2mml('\\grad{\\frac{a}{b}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_5', () => { - it('Vector_Divergence_0', () => { expect(tex2mml('a\\dotproduct b \\vdot c')).toMatchSnapshot(); }); @@ -637,15 +640,15 @@ describe('Physics2_5', () => { }); it('Vector_Divergence_5', () => { - expect(tex2mml('{\\bf\\nabla} \\cdot \\left(\\frac{a}{b}c\\right)')).toMatchSnapshot(); + expect( + tex2mml('{\\bf\\nabla} \\cdot \\left(\\frac{a}{b}c\\right)') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_6', () => { - it('Vector_Curl_0', () => { expect(tex2mml('\\curl ')).toMatchSnapshot(); }); @@ -661,13 +664,11 @@ describe('Physics2_6', () => { it('Vector_Curl_3', () => { expect(tex2mml('\\curl{\\frac{a}{b}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics2_7', () => { - it('Vector_Laplace_0', () => { expect(tex2mml('\\laplacian ')).toMatchSnapshot(); }); @@ -683,13 +684,11 @@ describe('Physics2_7', () => { it('Vector_Laplace_3', () => { expect(tex2mml('\\laplacian{\\frac{a}{b}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_0', () => { - it('Operators_Trig_0', () => { expect(tex2mml('\\sin(x)')).toMatchSnapshot(); }); @@ -737,13 +736,11 @@ describe('Physics3_0', () => { it('Operators_Trig_11', () => { expect(tex2mml('\\atan(x)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_1', () => { - it('Operators_Arc_0', () => { expect(tex2mml('\\csc(x)')).toMatchSnapshot(); }); @@ -791,13 +788,11 @@ describe('Physics3_1', () => { it('Operators_Arc_11', () => { expect(tex2mml('\\acot(x)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_2', () => { - it('Operators_TrigLarge_0', () => { expect(tex2mml('\\sin(\\frac{x}{y})')).toMatchSnapshot(); }); @@ -845,13 +840,11 @@ describe('Physics3_2', () => { it('Operators_TrigLarge_11', () => { expect(tex2mml('\\atan(\\frac{x}{y})')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_3', () => { - it('Operators_ArcLarge_0', () => { expect(tex2mml('\\csc(\\frac{x}{y})')).toMatchSnapshot(); }); @@ -899,13 +892,11 @@ describe('Physics3_3', () => { it('Operators_ArcLarge_11', () => { expect(tex2mml('\\acot(\\frac{x}{y})')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_4', () => { - it('Operators_Exp_0', () => { expect(tex2mml('\\sin x')).toMatchSnapshot(); }); @@ -973,13 +964,11 @@ describe('Physics3_4', () => { it('Operators_Exp_16', () => { expect(tex2mml('\\Pr[2](x)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_5', () => { - it('Operators_Operators_0', () => { expect(tex2mml('\\tr\\rho')).toMatchSnapshot(); }); @@ -1043,13 +1032,11 @@ describe('Physics3_5', () => { it('Operators_Operators_15', () => { expect(tex2mml('\\Res[2](\\frac{x}{y})')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_6', () => { - it('Operators_PV_0', () => { expect(tex2mml('\\principalvalue{\\int f(z) \\dd{z}}')).toMatchSnapshot(); }); @@ -1089,13 +1076,11 @@ describe('Physics3_6', () => { it('Operators_PV_9', () => { expect(tex2mml('\\PV\\int f(z) \\dd{z}a')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics3_7', () => { - it('Operators_Imaginary_0', () => { expect(tex2mml('\\Re\\rho')).toMatchSnapshot(); }); @@ -1167,13 +1152,11 @@ describe('Physics3_7', () => { it('Operators_Imaginary_17', () => { expect(tex2mml('\\imaginary{x}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics4_0', () => { - it('QuickQuad_0_0', () => { expect(tex2mml('\\qcc')).toMatchSnapshot(); }); @@ -1205,13 +1188,11 @@ describe('Physics4_0', () => { it('QuickQuad_0_7', () => { expect(tex2mml('three\\qif two')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_0', () => { - it('Derivatives_Deriv_0', () => { expect(tex2mml('\\dv x')).toMatchSnapshot(); }); @@ -1271,13 +1252,11 @@ describe('Physics5_0', () => { it('Derivatives_Deriv_14', () => { expect(tex2mml('\\dv{f}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_1', () => { - it('Derivatives_Partial_0', () => { expect(tex2mml('\\flatfrac{x}{y}')).toMatchSnapshot(); }); @@ -1353,13 +1332,11 @@ describe('Physics5_1', () => { it('Derivatives_Partial_18', () => { expect(tex2mml('\\pdv[5]{f}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_2', () => { - it('Derivatives_Functional_0', () => { expect(tex2mml('\\fdv x')).toMatchSnapshot(); }); @@ -1435,13 +1412,11 @@ describe('Physics5_2', () => { it('Derivatives_Functional_18', () => { expect(tex2mml('\\fdv[5]{f}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_3', () => { - it('Derivatives_Var_0', () => { expect(tex2mml('\\var A')).toMatchSnapshot(); }); @@ -1493,13 +1468,11 @@ describe('Physics5_3', () => { it('Derivatives_Var_12', () => { expect(tex2mml('A \\var[4]{A} B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_4', () => { - it('Derivatives_Differ_0', () => { expect(tex2mml('\\dd')).toMatchSnapshot(); }); @@ -1521,19 +1494,27 @@ describe('Physics5_4', () => { }); it('Derivatives_Differ_5', () => { - expect(tex2mml('\\dd(\\frac{\\frac{\\cos}{\\theta}}{\\theta})')).toMatchSnapshot(); + expect( + tex2mml('\\dd(\\frac{\\frac{\\cos}{\\theta}}{\\theta})') + ).toMatchSnapshot(); }); it('Derivatives_Differ_6', () => { - expect(tex2mml('\\dd[4](\\frac{\\frac{\\cos}{\\theta}}{\\theta})')).toMatchSnapshot(); + expect( + tex2mml('\\dd[4](\\frac{\\frac{\\cos}{\\theta}}{\\theta})') + ).toMatchSnapshot(); }); it('Derivatives_Differ_7', () => { - expect(tex2mml('\\dd{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})')).toMatchSnapshot(); + expect( + tex2mml('\\dd{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})') + ).toMatchSnapshot(); }); it('Derivatives_Differ_8', () => { - expect(tex2mml('\\dd[4]{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})')).toMatchSnapshot(); + expect( + tex2mml('\\dd[4]{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})') + ).toMatchSnapshot(); }); it('Derivatives_Differ_9', () => { @@ -1543,13 +1524,11 @@ describe('Physics5_4', () => { it('Derivatives_Differ_10', () => { expect(tex2mml('{\\dd}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics5_5', () => { - it('Derivatives_PDiff_0', () => { expect(tex2mml('A\\dd A')).toMatchSnapshot(); }); @@ -1579,39 +1558,49 @@ describe('Physics5_5', () => { }); it('Derivatives_PDiff_7', () => { - expect(tex2mml('A\\dd(\\frac{\\frac{\\cos}{\\theta}}{\\theta}) A')).toMatchSnapshot(); + expect( + tex2mml('A\\dd(\\frac{\\frac{\\cos}{\\theta}}{\\theta}) A') + ).toMatchSnapshot(); }); it('Derivatives_PDiff_8', () => { - expect(tex2mml('A\\dd[4](\\frac{\\frac{\\cos}{\\theta}}{\\theta})A')).toMatchSnapshot(); + expect( + tex2mml('A\\dd[4](\\frac{\\frac{\\cos}{\\theta}}{\\theta})A') + ).toMatchSnapshot(); }); it('Derivatives_PDiff_9', () => { - expect(tex2mml('A\\dd{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})A')).toMatchSnapshot(); + expect( + tex2mml('A\\dd{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})A') + ).toMatchSnapshot(); }); it('Derivatives_PDiff_10', () => { - expect(tex2mml('A\\dd[4]{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})A')).toMatchSnapshot(); + expect( + tex2mml('A\\dd[4]{x}(\\frac{\\frac{\\cos}{\\theta}}{\\theta})A') + ).toMatchSnapshot(); }); it('Derivatives_PDiff_11', () => { - expect(tex2mml( + expect( + tex2mml( 'A{\\rm d}\\left(\\frac{\\frac{\\cos}{\\theta}}{\\theta}\\right) A' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Derivatives_PDiff_12', () => { - expect(tex2mml( + expect( + tex2mml( 'A{\\rm d}{\\left(\\frac{\\frac{\\cos}{\\theta}}{\\theta}\\right)} A' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics6_0', () => { - it('BraKet_Bra_0', () => { expect(tex2mml('\\bra{\\phi}\\ket{\\psi}')).toMatchSnapshot(); }); @@ -1629,11 +1618,15 @@ describe('Physics6_0', () => { }); it('BraKet_Bra_4', () => { - expect(tex2mml('\\bra*{\\frac{a}{b}} \\ket{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\bra*{\\frac{a}{b}} \\ket{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('BraKet_Bra_5', () => { - expect(tex2mml('\\bra{\\frac{a}{b}} \\ket*{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\bra{\\frac{a}{b}} \\ket*{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('BraKet_Bra_6', () => { @@ -1683,13 +1676,11 @@ describe('Physics6_0', () => { it('BraKet_Bra_17', () => { expect(tex2mml('\\bra*{\\frac{1}{2}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics6_1', () => { - it('BraKet_Braket_0', () => { expect(tex2mml('\\braket{A}')).toMatchSnapshot(); }); @@ -1741,13 +1732,11 @@ describe('Physics6_1', () => { it('BraKet_Braket_12', () => { expect(tex2mml('\\braket*{\\frac{a}{b}}{}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics6_2', () => { - it('BraKet_Ketbra_0', () => { expect(tex2mml('\\ketbra{A}')).toMatchSnapshot(); }); @@ -1801,7 +1790,9 @@ describe('Physics6_2', () => { }); it('BraKet_Ketbra_13', () => { - expect(tex2mml('\\left\\vert A \\middle\\rangle\\middle\\langle B\\right\\vert')).toMatchSnapshot(); + expect( + tex2mml('\\left\\vert A \\middle\\rangle\\middle\\langle B\\right\\vert') + ).toMatchSnapshot(); }); it('BraKet_Ketbra_14', () => { @@ -1815,13 +1806,11 @@ describe('Physics6_2', () => { it('BraKet_Ketbra_16', () => { expect(tex2mml('\\dyad{a}{b}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics6_3', () => { - it('BraKet_Expect_0', () => { expect(tex2mml('\\ev{A}')).toMatchSnapshot(); }); @@ -1875,7 +1864,9 @@ describe('Physics6_3', () => { }); it('BraKet_Expect_13', () => { - expect(tex2mml('\\ev{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}')).toMatchSnapshot(); + expect( + tex2mml('\\ev{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}') + ).toMatchSnapshot(); }); it('BraKet_Expect_14', () => { @@ -1883,19 +1874,21 @@ describe('Physics6_3', () => { }); it('BraKet_Expect_15', () => { - expect(tex2mml('\\ev*{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}')).toMatchSnapshot(); + expect( + tex2mml('\\ev*{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}') + ).toMatchSnapshot(); }); it('BraKet_Expect_16', () => { - expect(tex2mml('\\ev**{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}')).toMatchSnapshot(); + expect( + tex2mml('\\ev**{\\frac{A}{B}}{\\frac{\\Psi}{\\Phi}}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics6_4', () => { - it('BraKet_MatrixEl_0', () => { expect(tex2mml('\\matrixel{n}{A}{m}')).toMatchSnapshot(); }); @@ -1905,7 +1898,9 @@ describe('Physics6_4', () => { }); it('BraKet_MatrixEl_2', () => { - expect(tex2mml('\\mel{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\mel{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('BraKet_MatrixEl_3', () => { @@ -1917,7 +1912,9 @@ describe('Physics6_4', () => { }); it('BraKet_MatrixEl_5', () => { - expect(tex2mml('\\mel*{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\mel*{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}') + ).toMatchSnapshot(); }); it('BraKet_MatrixEl_6', () => { @@ -1925,15 +1922,15 @@ describe('Physics6_4', () => { }); it('BraKet_MatrixEl_7', () => { - expect(tex2mml('\\mel**{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}')).toMatchSnapshot(); + expect( + tex2mml('\\mel**{\\frac{a}{b}}{\\frac{a}{b}}{\\frac{a}{b}}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_0', () => { - it('Matrices_Quantity_0', () => { expect(tex2mml('\\matrixquantity{Q}')).toMatchSnapshot(); }); @@ -1981,13 +1978,11 @@ describe('Physics7_0', () => { it('Matrices_Quantity_11', () => { expect(tex2mml('\\mqty*|a & b\\\\ c& d|')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_10', () => { - it('Matrices_Adiag_0', () => { expect(tex2mml('\\mqty(\\admat{1,2&3\\\\4&5})')).toMatchSnapshot(); }); @@ -2009,15 +2004,15 @@ describe('Physics7_10', () => { }); it('Matrices_Adiag_5', () => { - expect(tex2mml('\\mqty(\\admat{1,2&3\\\\4&5&6,7,8,\\dmat{9,10}})')).toMatchSnapshot(); + expect( + tex2mml('\\mqty(\\admat{1,2&3\\\\4&5&6,7,8,\\dmat{9,10}})') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_11', () => { - it('Matrices_Other_0', () => { expect(tex2mml('\\mqty a')).toMatchSnapshot(); }); @@ -2031,9 +2026,11 @@ describe('Physics7_11', () => { }); it('Matrices_Other_3', () => { - expect(tex2mml( + expect( + tex2mml( '\\mqty(\\dmat{1,2&3,4&4&5\\\\4&5,33,4,5,7,8\\\\0\\\\10&20\\\\3,200}) ' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Matrices_Other_4', () => { @@ -2041,21 +2038,29 @@ describe('Physics7_11', () => { }); it('Matrices_Other_5', () => { - expect(tex2mml('\\mqty(\\dmat{1,2&3\\\\4&5&6,\\imat{3},7,8,\\dmat{9,10}})')).toMatchSnapshot(); + expect( + tex2mml('\\mqty(\\dmat{1,2&3\\\\4&5&6,\\imat{3},7,8,\\dmat{9,10}})') + ).toMatchSnapshot(); }); it('Matrices_Other_6', () => { - expect(tex2mml( + expect( + tex2mml( '\\mqty(\\mqty{1}\\\\ & \\mqty{2 & 3\\\\ 4 & 5 & 6}\\\\ & & \\mqty{\\imat{3}} \\\\ & & & \\mqty{7})' - )).toMatchSnapshot(); + ) + ).toMatchSnapshot(); }); it('Matrices_Other_7', () => { - expect(tex2mml('\\left\\lgroup\\frac{a}{b}\\right\\rgroup')).toMatchSnapshot(); + expect( + tex2mml('\\left\\lgroup\\frac{a}{b}\\right\\rgroup') + ).toMatchSnapshot(); }); it('Matrices_Other_8', () => { - expect(tex2mml('\\begin{smallmatrix} a & b \\\\ c & d \\end{smallmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\begin{smallmatrix} a & b \\\\ c & d \\end{smallmatrix}') + ).toMatchSnapshot(); }); it('Matrices_Other_9', () => { @@ -2065,13 +2070,11 @@ describe('Physics7_11', () => { it('Matrices_Other_10', () => { expect(tex2mml('\\mqty{\\imat{10}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_1', () => { - it('Matrices_Fenced_0', () => { expect(tex2mml('\\pmqty{Q} \\mqty(R)')).toMatchSnapshot(); }); @@ -2103,31 +2106,37 @@ describe('Physics7_1', () => { it('Matrices_Fenced_7', () => { expect(tex2mml('\\vmqty{a & b \\\\ c & d}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_2', () => { - it('Matrices_Small_0', () => { expect(tex2mml('\\smallmatrixquantity{Q}')).toMatchSnapshot(); }); it('Matrices_Small_1', () => { - expect(tex2mml('\\smallmatrixquantity*{a & b \\\\ c & d}')).toMatchSnapshot(); + expect( + tex2mml('\\smallmatrixquantity*{a & b \\\\ c & d}') + ).toMatchSnapshot(); }); it('Matrices_Small_2', () => { - expect(tex2mml('\\smallmatrixquantity*(a & b \\\\ c & d)')).toMatchSnapshot(); + expect( + tex2mml('\\smallmatrixquantity*(a & b \\\\ c & d)') + ).toMatchSnapshot(); }); it('Matrices_Small_3', () => { - expect(tex2mml('\\smallmatrixquantity(a & b \\\\ c & d)')).toMatchSnapshot(); + expect( + tex2mml('\\smallmatrixquantity(a & b \\\\ c & d)') + ).toMatchSnapshot(); }); it('Matrices_Small_5', () => { - expect(tex2mml('\\smallmatrixquantity|a & b \\\\ c & d|')).toMatchSnapshot(); + expect( + tex2mml('\\smallmatrixquantity|a & b \\\\ c & d|') + ).toMatchSnapshot(); }); it('Matrices_Small_6', () => { @@ -2149,13 +2158,11 @@ describe('Physics7_2', () => { it('Matrices_Small_10', () => { expect(tex2mml('\\smqty|a & b \\\\ c & d|')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_3', () => { - it('Matrices_SmallFenced_0', () => { expect(tex2mml('\\spmqty{Q} \\smqty(R)')).toMatchSnapshot(); }); @@ -2187,13 +2194,11 @@ describe('Physics7_3', () => { it('Matrices_SmallFenced_7', () => { expect(tex2mml('\\svmqty{a & b \\\\ c & d}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_4', () => { - it('Matrices_Det_0', () => { expect(tex2mml('\\matrixdeterminant{a & b \\\\ c & d}')).toMatchSnapshot(); }); @@ -2217,13 +2222,11 @@ describe('Physics7_4', () => { it('Matrices_Det_5', () => { expect(tex2mml('\\smdet a b')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_5', () => { - it('Matrices_Identity_0', () => { expect(tex2mml('\\mqty{\\imat{3}}')).toMatchSnapshot(); }); @@ -2247,13 +2250,11 @@ describe('Physics7_5', () => { it('Matrices_Identity_5', () => { expect(tex2mml('\\pmqty{\\imat{3}\\pmat{0}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_6', () => { - it('Matrices_XMatrix_0', () => { expect(tex2mml('\\smqty(\\xmat{1}{2}{3})')).toMatchSnapshot(); }); @@ -2305,13 +2306,11 @@ describe('Physics7_6', () => { it('Matrices_XMatrix_12', () => { expect(tex2mml('\\smqty(\\zmat{3}{1})')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_7', () => { - it('Matrices_Pauli_0', () => { expect(tex2mml('\\mqty{\\pmat{0}}')).toMatchSnapshot(); }); @@ -2363,13 +2362,11 @@ describe('Physics7_7', () => { it('Matrices_Pauli_12', () => { expect(tex2mml('\\pmqty{\\pmat{0.a}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_8', () => { - it('Matrices_PauliFenced_0', () => { expect(tex2mml('\\pmqty{\\pmat{1}}')).toMatchSnapshot(); }); @@ -2401,13 +2398,11 @@ describe('Physics7_8', () => { it('Matrices_PauliFenced_7', () => { expect(tex2mml('\\pmqty{\\pmat{aa}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics7_9', () => { - it('Matrices_Diag_0', () => { expect(tex2mml('\\mqty(\\dmat{1,2&3\\\\4&5})')).toMatchSnapshot(); }); @@ -2429,31 +2424,33 @@ describe('Physics7_9', () => { }); it('Matrices_Diag_5', () => { - expect(tex2mml('\\mqty(\\dmat{1,2\\\\3\\\\4\\\\5\\\\6,7,8})')).toMatchSnapshot(); + expect( + tex2mml('\\mqty(\\dmat{1,2\\\\3\\\\4\\\\5\\\\6,7,8})') + ).toMatchSnapshot(); }); it('Matrices_Diag_6', () => { - expect(tex2mml('\\mqty(\\dmat{1,2&3\\\\4&5&6,7,8,\\dmat{9,10}})')).toMatchSnapshot(); + expect( + tex2mml('\\mqty(\\dmat{1,2&3\\\\4&5&6,7,8,\\dmat{9,10}})') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Physics Errors', () => { - it('MissingArgFor Quantity', () => { expectTexError('\\pqty').toBe('Missing argument for \\pqty'); }); it('MissingArgFor Commutator 1', () => { - expectTexError('\\commutator\\nix') - .toBe('Missing argument for \\commutator'); + expectTexError('\\commutator\\nix').toBe( + 'Missing argument for \\commutator' + ); }); it('MissingArgFor Commutator 2', () => { - expectTexError('\\commutator') - .toBe('Missing argument for \\commutator'); + expectTexError('\\commutator').toBe('Missing argument for \\commutator'); }); it('InvalidNumber IdentityMatrix', () => { @@ -2475,13 +2472,11 @@ describe('Physics Errors', () => { it('InvalidNumber XMatrix m+', () => { expectTexError('\\smqty(\\xmatrix{a}{2}{2.0})').toBe('Invalid number'); }); - }); /**********************************************************************************/ describe('Automatic Bracing Macros Rest', () => { - it('Quantities_Bracket', () => { expect(tex2mml('\\bqty\\Bigg{a}')).toMatchSnapshot(); }); @@ -2489,13 +2484,11 @@ describe('Automatic Bracing Macros Rest', () => { it('Quantities_Vert', () => { expect(tex2mml('\\vqty\\Bigg{a}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Vector Mo Rest', () => { - it('dotproduct', () => { expect(tex2mml('A \\dotproduct B')).toMatchSnapshot(); }); @@ -2519,13 +2512,11 @@ describe('Vector Mo Rest', () => { it('divisionsymbol', () => { expect(tex2mml('A \\divisionsymbol B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Expressions Macros Rest', () => { - it('trace', () => { expect(tex2mml('\\trace(x)')).toMatchSnapshot(); }); @@ -2645,13 +2636,11 @@ describe('Expressions Macros Rest', () => { it('Probability', () => { expect(tex2mml('\\Probability(x)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Derivative Macros Rest', () => { - it('differential', () => { expect(tex2mml('\\differential')).toMatchSnapshot(); }); @@ -2703,13 +2692,11 @@ describe('Derivative Macros Rest', () => { it('pderivative four arg', () => { expect(tex2mml('\\pderivative{x}{y}{z}{a}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Quick Quad Macros Rest', () => { - it('qq', () => { expect(tex2mml('A \\qq B')).toMatchSnapshot(); }); @@ -2785,13 +2772,11 @@ describe('Quick Quad Macros Rest', () => { it('qin', () => { expect(tex2mml('A \\qin B')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Bra-Ket Macros Rest', () => { - it('innerproduct arg one', () => { expect(tex2mml('\\innerproduct{A}')).toMatchSnapshot(); }); @@ -2859,13 +2844,11 @@ describe('Bra-Ket Macros Rest', () => { it('matrixelement arg four', () => { expect(tex2mml('\\matrixelement{A}{B}{C}{D}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Matrix Macros Rest', () => { - it('zeromatrix', () => { expect(tex2mml('\\pmqty{\\zeromatrix{2}{3}}')).toMatchSnapshot(); }); @@ -2895,15 +2878,15 @@ describe('Matrix Macros Rest', () => { }); it('antidiagonalmatrix', () => { - expect(tex2mml('\\pmqty{\\antidiagonalmatrix{0,1\\\\2&3}}')).toMatchSnapshot(); + expect( + tex2mml('\\pmqty{\\antidiagonalmatrix{0,1\\\\2&3}}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Rest for Completion', () => { - it('Issue 2831', () => { expect(tex2mml('\\exp((\\frac{a}{a}a){a})')).toMatchSnapshot(); }); @@ -2911,13 +2894,16 @@ describe('Rest for Completion', () => { it('Issue 3000', () => { expect(tex2mml('\\sin(1\\over2)')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Options', () => { - beforeEach(() => setupTex(['base', 'physics'], { physics: { arrowdel: true, italicdiff: true } })); + beforeEach(() => + setupTex(['base', 'physics'], { + physics: { arrowdel: true, italicdiff: true }, + }) + ); it('Arrowdel true', () => { expect(tex2mml('\\vnabla')).toMatchSnapshot(); @@ -2926,7 +2912,6 @@ describe('Options', () => { it('Italicdif true', () => { expect(tex2mml('\\dd{x}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Require.test.ts b/testsuite/tests/input/tex/Require.test.ts index 3ee1acf8a..ec383f255 100644 --- a/testsuite/tests/input/tex/Require.test.ts +++ b/testsuite/tests/input/tex/Require.test.ts @@ -4,12 +4,12 @@ import { setupTexTypeset, typeset2mml, setupComponents, - expectTypesetError + expectTypesetError, } from '#helpers'; -import {Configuration} from '#js/input/tex/Configuration.js'; -import {HandlerType, ConfigurationType} from '#js/input/tex/HandlerTypes.js'; -import {CommandMap} from '#js/input/tex/TokenMap.js'; +import { Configuration } from '#js/input/tex/Configuration.js'; +import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js'; +import { CommandMap } from '#js/input/tex/TokenMap.js'; declare const MathJax: any; @@ -17,11 +17,11 @@ setupComponents({ loader: { load: ['input/tex-base', '[tex]/require'], source: { - '[tex]/error': '../../testsuite/lib/error.js' + '[tex]/error': '../../testsuite/lib/error.js', }, dependencies: { - '[tex]/upgreek': ['input/tex-base', '[tex]/error'] - } + '[tex]/upgreek': ['input/tex-base', '[tex]/error'], + }, }, startup: { ready() { @@ -34,16 +34,16 @@ setupComponents({ constructor(...args: any[]) { super(...args); this.menu = { - addRequiredExtensions(_required: any) {} - } + addRequiredExtensions(_required: any) {}, + }; } } handler.documentClass = myMenuDoc; return handler; }, 20); MathJax.startup.defaultReady(); - } - } + }, + }, }); /**********************************************************************************/ @@ -51,17 +51,22 @@ setupComponents({ beforeEach(() => setupTexTypeset(['base', 'require'])); describe('Require', () => { - test('Require package', async () => { - expect(await typeset2mml('\\require{bbox} \\bbox[red]{x}')).toMatchSnapshot(); + expect( + await typeset2mml('\\require{bbox} \\bbox[red]{x}') + ).toMatchSnapshot(); }); test('Require with dependencies', async () => { - expect(await typeset2mml('\\require{cancel} \\cancel{x+1}')).toMatchSnapshot(); + expect( + await typeset2mml('\\require{cancel} \\cancel{x+1}') + ).toMatchSnapshot(); }); test('Require with preprocessors', async () => { - expect(await typeset2mml('\\require{textcomp} \\text{a \\bf b}')).toMatchSnapshot(); + expect( + await typeset2mml('\\require{textcomp} \\text{a \\bf b}') + ).toMatchSnapshot(); }); test('Require with stack items', async () => { @@ -73,13 +78,15 @@ describe('Require', () => { }); test('Bad Package name', async () => { - await expectTypesetError('\\require{***}') - .toBe('Argument for \\require is not a valid package name'); + await expectTypesetError('\\require{***}').toBe( + 'Argument for \\require is not a valid package name' + ); }); test('Restricted Package', async () => { - await expectTypesetError('\\require{tagformat}') - .toBe('Extension "[tex]/tagformat" is not allowed to be loaded'); + await expectTypesetError('\\require{tagformat}').toBe( + 'Extension "[tex]/tagformat" is not allowed to be loaded' + ); }); test('Dependency error', async () => { @@ -89,51 +96,66 @@ describe('Require', () => { test('Failed to load error', async () => { setupTexTypeset(['base', 'require']); - await expectTypesetError('\\require{xyz}').toBe('Extension "xyz" failed to load'); + await expectTypesetError('\\require{xyz}').toBe( + 'Extension "xyz" failed to load' + ); }); - }); /**********************************************************************************/ describe('Require Options', () => { - test('Illegal Prefix', async () => { - setupTexTypeset(['base', 'require'], {require: {prefix: '***'}}); - await expectTypesetError('').toBe('Illegal characters used in \\require prefix'); + setupTexTypeset(['base', 'require'], { require: { prefix: '***' } }); + await expectTypesetError('').toBe( + 'Illegal characters used in \\require prefix' + ); }); test('Prefix', async () => { - setupTexTypeset(['base', 'require'], {require: {prefix: 'test'}}); - expect(typeset2mml('').then(() => 'OK').catch((e) => e.message)) - .resolves.toBe('OK'); + setupTexTypeset(['base', 'require'], { require: { prefix: 'test' } }); + expect( + typeset2mml('') + .then(() => 'OK') + .catch((e) => e.message) + ).resolves.toBe('OK'); }); test('DefaultAllow with allow', async () => { - setupTexTypeset(['base', 'require'], {require: {defaultAllow: false, allow: {bbox: true}}}); - expect(await typeset2mml('\\require{bbox} \\bbox[red]{x}')).toMatchSnapshot(); + setupTexTypeset(['base', 'require'], { + require: { defaultAllow: false, allow: { bbox: true } }, + }); + expect( + await typeset2mml('\\require{bbox} \\bbox[red]{x}') + ).toMatchSnapshot(); }); test('Prefixed options', async () => { - setupTexTypeset(['base', 'require'], {require: {defaultAllow: false, allow: {'[tex]/bbox': true}}}); - expect(await typeset2mml('\\require{bbox} \\bbox[red]{x}')).toMatchSnapshot(); + setupTexTypeset(['base', 'require'], { + require: { defaultAllow: false, allow: { '[tex]/bbox': true } }, + }); + expect( + await typeset2mml('\\require{bbox} \\bbox[red]{x}') + ).toMatchSnapshot(); }); test('RequireLoad with prefix', async () => { new CommandMap('require-load', { requireLoad(parser: any) { - MathJax._.input.tex.require.RequireConfiguration.RequireLoad(parser, '[tex]/bbox'); - } + MathJax._.input.tex.require.RequireConfiguration.RequireLoad( + parser, + '[tex]/bbox' + ); + }, }); Configuration.create('require-load', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['require-load'] - } + [HandlerType.MACRO]: ['require-load'], + }, }); setupTexTypeset(['base', 'require', 'require-load']); expect(await typeset2mml('\\requireLoad \\bbox[red]{x}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/SetOptions.test.ts b/testsuite/tests/input/tex/SetOptions.test.ts index 91f827249..a292a8495 100644 --- a/testsuite/tests/input/tex/SetOptions.test.ts +++ b/testsuite/tests/input/tex/SetOptions.test.ts @@ -5,7 +5,7 @@ import { tex2mml, typeset2mml, setupComponents, - expectTexError + expectTexError, } from '#helpers'; import '#js/input/tex/setoptions/SetOptionsConfiguration'; import '#js/input/tex/ams/AmsConfiguration'; @@ -14,7 +14,6 @@ import '#js/input/tex/units/UnitsConfiguration'; /**********************************************************************************/ describe('Setoptions', () => { - beforeEach(() => setupTex(['base', 'ams', 'units', 'setoptions'])); test('Set TeX option', () => { @@ -22,146 +21,193 @@ describe('Setoptions', () => { }); test('Set invalid option', () => { - expectTexError('\\setOptions{x=y}') - .toBe('Invalid TeX option "x"'); + expectTexError('\\setOptions{x=y}').toBe('Invalid TeX option "x"'); }); test('Set prohibited option', () => { - expectTexError('\\setOptions{tags=all}') - .toBe('Option "tags" is not allowed to be set'); + expectTexError('\\setOptions{tags=all}').toBe( + 'Option "tags" is not allowed to be set' + ); }); test('Set invalid package', () => { - expectTexError('\\setOptions[abc]{x=y}') - .toBe('Not a defined package: abc'); + expectTexError('\\setOptions[abc]{x=y}').toBe('Not a defined package: abc'); }); test('Set prohibited package', () => { - expectTexError('\\setOptions[setoptions]{setoptions=true}') - .toBe(`Options can't be set for package "setoptions"`); + expectTexError('\\setOptions[setoptions]{setoptions=true}').toBe( + `Options can't be set for package "setoptions"` + ); }); test('Set package string option', () => { - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); }); test('Set package boolean option', () => { - expect(tex2mml('\\setOptions[units]{loose=true} \\units[1]{kg}')).toMatchSnapshot(); + expect( + tex2mml('\\setOptions[units]{loose=true} \\units[1]{kg}') + ).toMatchSnapshot(); }); test('Set pacjage regexp option', () => { - expect(tex2mml('\\setOptions[ams]{operatornamePattern=/^[a-z0-9]+/} \\operatorname{ab1}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{operatornamePattern=/^[a-z0-9]+/} \\operatorname{ab1}' + ) + ).toMatchSnapshot(); }); test('Set regexp option with flags', () => { - expect(tex2mml('\\setOptions[ams]{operatornamePattern=/^[a-z0-9]+/i} \\operatorname{ab1}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{operatornamePattern=/^[a-z0-9]+/i} \\operatorname{ab1}' + ) + ).toMatchSnapshot(); }); test('Set invalid package option', () => { - expectTexError('\\setOptions[ams]{x=y}') - .toBe('Invalid option "x" for package "ams"'); + expectTexError('\\setOptions[ams]{x=y}').toBe( + 'Invalid option "x" for package "ams"' + ); }); - }); /**********************************************************************************/ describe('Setoptions options', () => { - - test('allowPackageDefault false',() => { - setupTex(['base', 'ams', 'setoptions'], {setoptions: {allowPackageDefault: false}}); - expectTexError('\\setOptions[ams]{multlineWidth=50%}') - .toBe(`Options can't be set for package "ams"`); + test('allowPackageDefault false', () => { + setupTex(['base', 'ams', 'setoptions'], { + setoptions: { allowPackageDefault: false }, + }); + expectTexError('\\setOptions[ams]{multlineWidth=50%}').toBe( + `Options can't be set for package "ams"` + ); }); - test('allowPackageDefault false ams true',() => { + test('allowPackageDefault false ams true', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { allowPackageDefault: false, - allowOptions: {ams: true} - } + allowOptions: { ams: true }, + }, }); - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); }); - test('allowOptionsDefault false',() => { - setupTex(['base', 'ams', 'setoptions'], {setoptions: {allowOptionsDefault: false}}); - expectTexError('\\setOptions[ams]{multlineWidth=50%}') - .toBe('Option "multlineWidth" is not allowed to be set for package ams'); + test('allowOptionsDefault false', () => { + setupTex(['base', 'ams', 'setoptions'], { + setoptions: { allowOptionsDefault: false }, + }); + expectTexError('\\setOptions[ams]{multlineWidth=50%}').toBe( + 'Option "multlineWidth" is not allowed to be set for package ams' + ); }); - test('allowOptionsDefault false ams true',() => { + test('allowOptionsDefault false ams true', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { allowOptionsDefault: false, - allowOptions: {ams: true} - } + allowOptions: { ams: true }, + }, }); - expectTexError('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}') - .toBe('Option "multlineWidth" is not allowed to be set for package ams'); + expectTexError( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ).toBe('Option "multlineWidth" is not allowed to be set for package ams'); }); - test('allowOptionsDefault false ams multlineWidth true',() => { + test('allowOptionsDefault false ams multlineWidth true', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { allowOptionsDefault: false, allowOptions: { - ams: {multlineWidth: true} - } - } + ams: { multlineWidth: true }, + }, + }, }); - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); - expectTexError('\\setOptions[ams]{multlineIndent=50%} \\begin{multline} a \\end{multline}') - .toBe('Option "multlineIndent" is not allowed to be set for package ams'); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); + expectTexError( + '\\setOptions[ams]{multlineIndent=50%} \\begin{multline} a \\end{multline}' + ).toBe('Option "multlineIndent" is not allowed to be set for package ams'); }); - test('filterPackage',() => { + test('filterPackage', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { - filterPackage: (_parser: any, _extension: string) => false - } + filterPackage: (_parser: any, _extension: string) => false, + }, }); - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); }); - test('filterOption',() => { + test('filterOption', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { - filterOption: (_parser: any, _extension: string, _key: string) => false - } + filterOption: (_parser: any, _extension: string, _key: string) => false, + }, }); - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); }); - test('filterValue',() => { + test('filterValue', () => { setupTex(['base', 'ams', 'setoptions'], { setoptions: { - filterValue: (_parser: any, _extension: string, _option: string, _value: string) => '25%' - } + filterValue: ( + _parser: any, + _extension: string, + _option: string, + _value: string + ) => '25%', + }, }); - expect(tex2mml('\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}')).toMatchSnapshot(); + expect( + tex2mml( + '\\setOptions[ams]{multlineWidth=50%} \\begin{multline} a \\end{multline}' + ) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Setoptions Require', () => { - setupComponents({ - loader: {load: ['input/tex-base', '[tex]/require']} + loader: { load: ['input/tex-base', '[tex]/require'] }, }); beforeEach(() => setupTexTypeset(['base', 'require', 'setoptions'])); test('Require', async () => { - expect(await typeset2mml('\\require{bbox} \\bbox[red]{x}')).toMatchSnapshot(); + expect( + await typeset2mml('\\require{bbox} \\bbox[red]{x}') + ).toMatchSnapshot(); }); test('Require with option', async () => { - expect(await typeset2mml('\\require[ugly=true]{units} \\nicefrac{a}{b}')).toMatchSnapshot(); + expect( + await typeset2mml('\\require[ugly=true]{units} \\nicefrac{a}{b}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Tag.test.ts b/testsuite/tests/input/tex/Tag.test.ts index 8fb0c9c1c..91ac9294f 100644 --- a/testsuite/tests/input/tex/Tag.test.ts +++ b/testsuite/tests/input/tex/Tag.test.ts @@ -171,7 +171,6 @@ describe('TagAll', () => { ) ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -344,7 +343,6 @@ describe('TagNone', () => { ) ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -513,7 +511,6 @@ describe('TagAms', () => { ) ).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -545,5 +542,4 @@ describe('Page References', () => { setupTex(['base', 'ams'], { useLabelIds: false }); expect(tex2mml('a\\label{eq1}\\tag{1}')).toMatchSnapshot(); }); - }); diff --git a/testsuite/tests/input/tex/TagFormat.test.ts b/testsuite/tests/input/tex/TagFormat.test.ts index c28dfc7e3..0be1f3a9c 100644 --- a/testsuite/tests/input/tex/TagFormat.test.ts +++ b/testsuite/tests/input/tex/TagFormat.test.ts @@ -3,20 +3,22 @@ import { setupTex, tex2mml } from '#helpers'; import '#js/input/tex/tagformat/TagFormatConfiguration'; import '#js/input/tex/ams/AmsConfiguration'; -beforeEach(() => setupTex(['base', 'ams', 'tagformat'], { - tagformat: { - number: (n: number) => `A${n}`, - tag: (tag: string) => `[${tag}]`, - id: (id: string) => 'my-tag:' + id.replace(/\s/g, '_'), - url: (id: string, base: string) => `[[${base}#${encodeURIComponent(id)}]]` - }, - tags: 'ams' -})); +beforeEach(() => + setupTex(['base', 'ams', 'tagformat'], { + tagformat: { + number: (n: number) => `A${n}`, + tag: (tag: string) => `[${tag}]`, + id: (id: string) => 'my-tag:' + id.replace(/\s/g, '_'), + url: (id: string, base: string) => + `[[${base}#${encodeURIComponent(id)}]]`, + }, + tags: 'ams', + }) +); /**********************************************************************************/ describe('Tagformat', () => { - test('Basic tag', () => { expect(tex2mml('x \\tag{1}')).toMatchSnapshot(); }); @@ -26,21 +28,33 @@ describe('Tagformat', () => { }); test('Ref', () => { - expect(tex2mml('\\begin{align}x \\label{test}\\tag{x}\\\\ \\ref{test} \\end{align}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{align}x \\label{test}\\tag{x}\\\\ \\ref{test} \\end{align}' + ) + ).toMatchSnapshot(); }); test('Eqref', () => { - expect(tex2mml('\\begin{align}x \\label{test}\\tag{x}\\\\ \\eqref{test} \\end{align}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{align}x \\label{test}\\tag{x}\\\\ \\eqref{test} \\end{align}' + ) + ).toMatchSnapshot(); }); test('Custom ref', () => { setupTex(['base', 'ams', 'tagformat'], { tagformat: { - ref: (tag: string) => `**${tag}**` + ref: (tag: string) => `**${tag}**`, }, - tags: 'ams' + tags: 'ams', }); - expect(tex2mml('\\begin{align}x \\label{test}\\tag{x}\\\\ \\eqref{test} \\end{align}')).toMatchSnapshot(); + expect( + tex2mml( + '\\begin{align}x \\label{test}\\tag{x}\\\\ \\eqref{test} \\end{align}' + ) + ).toMatchSnapshot(); }); test('Array tag', () => { @@ -48,7 +62,7 @@ describe('Tagformat', () => { tagformat: { tag: (tag: string) => ['|', tag, '|'], }, - tags: 'ams' + tags: 'ams', }); expect(tex2mml('x \\tag{1}')).toMatchSnapshot(); }); @@ -58,7 +72,7 @@ describe('Tagformat', () => { tagformat: { tag: (tag: string) => ['', tag, '.'], }, - tags: 'ams' + tags: 'ams', }); expect(tex2mml('x \\tag{1}')).toMatchSnapshot(); }); @@ -66,13 +80,12 @@ describe('Tagformat', () => { test('Array tag with null entry', () => { setupTex(['base', 'ams', 'tagformat'], { tagformat: { - tag: (tag: string) => [ , tag, '.'], + tag: (tag: string) => ['', tag, '.'], }, - tags: 'ams' + tags: 'ams', }); expect(tex2mml('x \\tag{1}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Tex.test.ts b/testsuite/tests/input/tex/Tex.test.ts index 4f27c145d..01c139fae 100644 --- a/testsuite/tests/input/tex/Tex.test.ts +++ b/testsuite/tests/input/tex/Tex.test.ts @@ -8,7 +8,7 @@ import { setupComponents, trapOutput, trapErrors, - expectTexError + expectTexError, } from '#helpers'; import '#js/input/tex/ams/AmsConfiguration'; import '#js/input/tex/newcommand/NewcommandConfiguration'; @@ -16,13 +16,20 @@ import '#js/input/tex/newcommand/NewcommandConfiguration'; import { TeX } from '#js/input/tex.js'; import { MmlFactory } from '#js/core/MmlTree/MmlFactory.js'; -import { Configuration, ConfigurationHandler } from '#js/input/tex/Configuration.js'; +import { + Configuration, + ConfigurationHandler, +} from '#js/input/tex/Configuration.js'; import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js'; import { CommandMap } from '#js/input/tex/TokenMap.js'; import { Token } from '#js/input/tex/Token.js'; import { TagsFactory } from '#js/input/tex/Tags.js'; import TexError from '#js/input/tex/TexError.js'; -import { ParseUtil, KeyValueTypes, KeyValueDef } from '#js/input/tex/ParseUtil.js'; +import { + ParseUtil, + KeyValueTypes, + KeyValueDef, +} from '#js/input/tex/ParseUtil.js'; /**********************************************************************************/ @@ -36,48 +43,57 @@ describe('TeX', () => { /**********************************************************************************/ describe('NodeFactory', () => { - test('createText null text', () => { - expect(tex.parseOptions.nodeFactory.create('text', null)).toBe(null) + expect(tex.parseOptions.nodeFactory.create('text', null)).toBe(null); }); test('create null kind', () => { expect( - toMathML(tex.parseOptions.nodeFactory.create('undefined', 'mi'))).toMatchSnapshot(); + toMathML(tex.parseOptions.nodeFactory.create('undefined', 'mi')) + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('NodeUtil', () => { - test('inferred propery', () => { - const mrow = tex.parseOptions.nodeFactory.create('node', 'mrow', [], {inferred: true}); + const mrow = tex.parseOptions.nodeFactory.create('node', 'mrow', [], { + inferred: true, + }); expect(mrow.getProperty('inferred')).toBe(undefined); }); - }); /**********************************************************************************/ describe('Stack', () => { - - new CommandMap('stackMacros', { - showStack: (parser) => {parser.stack.toString()}, - getTop: 'getTop' // coverage for macro defined by name of method in methods object - }, { - getTop: (parser) => { - const top = parser.stack.Top(5); - const mtext = parser.create('token', 'mtext', {}, top === null ? 'yes' : 'no'); - parser.Push(mtext); + new CommandMap( + 'stackMacros', + { + showStack: (parser) => { + parser.stack.toString(); + }, + getTop: 'getTop', // coverage for macro defined by name of method in methods object }, - }); + { + getTop: (parser) => { + const top = parser.stack.Top(5); + const mtext = parser.create( + 'token', + 'mtext', + {}, + top === null ? 'yes' : 'no' + ); + parser.Push(mtext); + }, + } + ); Configuration.create('stackMacros', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['stackMacros'] - } + [HandlerType.MACRO]: ['stackMacros'], + }, }); beforeEach(() => setupTex(['base', 'stackMacros'])); @@ -90,41 +106,37 @@ describe('Stack', () => { setupTex(['base', 'stackMacros']); expect(tex2mml('\\getTop')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Token', () => { - test('token', () => { const token = new Token('x', 'y', {}); expect(token.token).toBe('x'); }); - }); /**********************************************************************************/ describe('Tags', () => { - test('noTag', () => { expect((tex.parseOptions.tags as any).noTag).toBe(false); }); test('Unknown default', () => { TagsFactory.setDefault('unknown'); - const message = trapErrors(() => {TagsFactory.create('error')}); + const message = trapErrors(() => { + TagsFactory.create('error'); + }); TagsFactory.setDefault('none'); expect(message).toBe('Unknown tags class'); }); - }); /**********************************************************************************/ describe('TexError', () => { - test('Number argument', () => { const err = new TexError('test', 'Number: %1', 1 as any); expect(err.message).toBe('Number: 1'); @@ -144,42 +156,37 @@ describe('TexError', () => { const err = new TexError('test', '10%%'); expect(err.message).toBe('10%'); }); - }); /**********************************************************************************/ setupComponents({ - loader: {load: ['input/tex-base']} + loader: { load: ['input/tex-base'] }, }); describe('FindTeX', () => { - setupTexPage(['base']); test('display math', async () => { - expect( - await page2mml('abc $$ x + 1 $$ def')).toMatchSnapshot(); + expect(await page2mml('abc $$ x + 1 $$ def')).toMatchSnapshot(); }); test('environment', async () => { expect( - await page2mml('abc \\begin{equation} x=y \\end{equation} def')).toMatchSnapshot(); + await page2mml('abc \\begin{equation} x=y \\end{equation} def') + ).toMatchSnapshot(); }); test('Nested braces', async () => { - expect( - await page2mml('abc $$a + {\\bf b} + c$$ def')).toMatchSnapshot(); + expect(await page2mml('abc $$a + {\\bf b} + c$$ def')).toMatchSnapshot(); }); test('processEscapes', async () => { - expect( - await page2mml('abc \\$ def')).toMatchSnapshot(); + expect(await page2mml('abc \\$ def')).toMatchSnapshot(); }); test('ref undefined', async () => { - expect( - await page2mml('abc \\ref{x} def')).toMatchSnapshot(); + expect(await page2mml('abc \\ref{x} def')).toMatchSnapshot(); }); test('No close delim', () => { @@ -189,13 +196,11 @@ describe('FindTeX', () => { test('No close delim', () => { expect(page2mml('abc \\begin{align} x + 1')).resolves.toEqual([]); }); - }); /**********************************************************************************/ describe('Configuration', () => { - test('keys', () => { expect(Array.from(ConfigurationHandler.keys()).length > 0).toBe(true); }); @@ -203,7 +208,7 @@ describe('Configuration', () => { test('init', () => { const init = () => {}; const config = Configuration.create('init', { - [ConfigurationType.INIT]: init + [ConfigurationType.INIT]: init, }); expect(config.init).toBe(init); }); @@ -215,54 +220,74 @@ describe('Configuration', () => { test('Package priority', () => { const order: number[] = []; Configuration.create('priority 1', { - [ConfigurationType.INIT]: () => {order.push(1)} + [ConfigurationType.INIT]: () => { + order.push(1); + }, }); Configuration.create('priority 2', { - [ConfigurationType.INIT]: () => {order.push(2)} + [ConfigurationType.INIT]: () => { + order.push(2); + }, }); - setupTex([['priority 1', 1], ['priority 2', 2]]); + setupTex([ + ['priority 1', 1], + ['priority 2', 2], + ]); expect(order).toEqual([1, 2]); - setupTex([['priority 1', 2], ['priority 2', 1]]); + setupTex([ + ['priority 1', 2], + ['priority 2', 1], + ]); expect(order).toEqual([1, 2, 2, 1]); }); test('Parser error', () => { Configuration.create('error', { - [ConfigurationType.PARSER]: 'error' + [ConfigurationType.PARSER]: 'error', + }); + const message = trapErrors(() => { + new TeX({ packages: ['base', 'error'] }); }); - const message = trapErrors(() => {new TeX({packages: ['base', 'error']})}); expect(message).toBe("Package 'error' doesn't target the proper parser"); }); test('Package error', () => { - const message = trapOutput('warn', () => new TeX({packages: ['base', 'undefined']})); - expect(message).toBe("MathJax Warning: Package 'undefined' not found. Omitted."); + const message = trapOutput( + 'warn', + () => new TeX({ packages: ['base', 'undefined'] }) + ); + expect(message).toBe( + "MathJax Warning: Package 'undefined' not found. Omitted." + ); }); - }); /**********************************************************************************/ describe('MapHandler', () => { - test('Undefined', () => { Configuration.create('BadHandler', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['undefindHandler'] - } + [HandlerType.MACRO]: ['undefindHandler'], + }, }); - const message = trapOutput('log', () => new TeX({packages: ['base', 'BadHandler']})); - expect(message).toBe("TexParser Warning: Configuration 'undefindHandler' not found! Omitted."); + const message = trapOutput( + 'log', + () => new TeX({ packages: ['base', 'BadHandler'] }) + ); + expect(message).toBe( + "TexParser Warning: Configuration 'undefindHandler' not found! Omitted." + ); }); test('remove', () => { const fallback = () => {}; Configuration.create('fallback', { [ConfigurationType.FALLBACK]: { - [HandlerType.MACRO]: fallback - } + [HandlerType.MACRO]: fallback, + }, }); - const tex = new TeX({packages: ['fallback']}); + const tex = new TeX({ packages: ['fallback'] }); const map = (tex as any).configuration.handlers.get(HandlerType.MACRO); expect(Array.from((map as any)._fallback).length).toBe(1); map.remove([], fallback); @@ -271,8 +296,9 @@ describe('MapHandler', () => { test('toString', () => { const map = (tex as any).configuration.handlers.get(HandlerType.MACRO); - expect(map.toString()) - .toBe('mathchar7, mathchar0mo, mathchar0mi, ucGreek, lcGreek, macros, delimiter'); + expect(map.toString()).toBe( + 'mathchar7, mathchar0mo, mathchar0mi, ucGreek, lcGreek, macros, delimiter' + ); }); test('retrieve', () => { @@ -282,26 +308,26 @@ describe('MapHandler', () => { test('keys', () => { const handlers = (tex as any).configuration.handlers; - expect(Array.from(handlers.keys()).sort()).toEqual(Object.values(HandlerType).sort()); + expect(Array.from(handlers.keys()).sort()).toEqual( + Object.values(HandlerType).sort() + ); }); - }); /**********************************************************************************/ describe('TexParser', () => { - test('toString', () => { let output = ''; new CommandMap('showParser', { showparser(parser: any) { output = parser.toString(); - } + }, }); Configuration.create('showParser', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['showParser'] - } + [HandlerType.MACRO]: ['showParser'], + }, }); setupTex(['base', 'showParser']); tex2mml('\\showparser'); @@ -311,7 +337,7 @@ describe('TexParser', () => { 'delimiter: delimiter', 'macro: showParser, mathchar7, mathchar0mo, mathchar0mi, ucGreek, lcGreek, macros, delimiter', 'environment: environment', - '' + '', ].join('\n') ); }); @@ -326,12 +352,12 @@ describe('TexParser', () => { matchbrackets(parser: any, name: string) { const arg = parser.GetBrackets(name, '', true); parser.Push(parser.create('token', 'mtext', {}, arg)); - } + }, }); Configuration.create('matchBrackets', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['matchBrackets'] - } + [HandlerType.MACRO]: ['matchBrackets'], + }, }); setupTex(['base', 'matchBrackets']); expect(tex2mml('\\matchbrackets[[x]]')).toMatchSnapshot(); @@ -341,12 +367,12 @@ describe('TexParser', () => { new CommandMap('mml', { mml(parser: any) { parser.mml(); - } + }, }); Configuration.create('mml', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['mml'] - } + [HandlerType.MACRO]: ['mml'], + }, }); setupTex(['base', 'mml']); expect(tex2mml('{\\mml}')).toMatchSnapshot(); @@ -354,37 +380,41 @@ describe('TexParser', () => { test('Removed delimiter', () => { setupTex(['base', 'ams', 'newcommand']); - expect(tex2mml('\\let\\vert=x \\begin{vmatrix} a \\end{vmatrix}')).toMatchSnapshot(); + expect( + tex2mml('\\let\\vert=x \\begin{vmatrix} a \\end{vmatrix}') + ).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('ParseUtil', () => { - test('keyValue', () => { - expect(ParseUtil.keyvalOptions('ab')).toEqual({ab: true}); - expect(ParseUtil.keyvalOptions('ab=true')).toEqual({ab: true}); - expect(ParseUtil.keyvalOptions('ab=false')).toEqual({ab: false}); - expect(ParseUtil.keyvalOptions('ab=xyz')).toEqual({ab: 'xyz'}); - expect(ParseUtil.keyvalOptions('ab=')).toEqual({ab: ''}); - expect(ParseUtil.keyvalOptions('{ab=}')).toEqual({ab: ''}); - expect(ParseUtil.keyvalOptions('{{ab=}}')).toEqual({'ab=': true}); - expect(ParseUtil.keyvalOptions('ab=1,cd')).toEqual({'ab': "1", cd: true}); - expect(ParseUtil.keyvalOptions('ab cd=x')).toEqual({'ab cd': 'x'}); - expect(ParseUtil.keyvalOptions('{ab,c=d}=x')).toEqual({'ab,c=d': 'x'}); - expect(ParseUtil.keyvalOptions('ab=\\x')).toEqual({ab: '\\x'}); - expect(ParseUtil.keyvalOptions('ab=\\{')).toEqual({ab: '\\{'}); - expect(ParseUtil.keyvalOptions('ab={a\\{b}')).toEqual({ab: 'a\\{b'}); - expect(ParseUtil.keyvalOptions('ab=\\')).toEqual({ab: '\\'}); - expect(ParseUtil.keyvalOptions('a\\b=c')).toEqual({'a\\b': 'c'}); + expect(ParseUtil.keyvalOptions('ab')).toEqual({ ab: true }); + expect(ParseUtil.keyvalOptions('ab=true')).toEqual({ ab: true }); + expect(ParseUtil.keyvalOptions('ab=false')).toEqual({ ab: false }); + expect(ParseUtil.keyvalOptions('ab=xyz')).toEqual({ ab: 'xyz' }); + expect(ParseUtil.keyvalOptions('ab=')).toEqual({ ab: '' }); + expect(ParseUtil.keyvalOptions('{ab=}')).toEqual({ ab: '' }); + expect(ParseUtil.keyvalOptions('{{ab=}}')).toEqual({ 'ab=': true }); + expect(ParseUtil.keyvalOptions('ab=1,cd')).toEqual({ ab: '1', cd: true }); + expect(ParseUtil.keyvalOptions('ab cd=x')).toEqual({ 'ab cd': 'x' }); + expect(ParseUtil.keyvalOptions('{ab,c=d}=x')).toEqual({ 'ab,c=d': 'x' }); + expect(ParseUtil.keyvalOptions('ab=\\x')).toEqual({ ab: '\\x' }); + expect(ParseUtil.keyvalOptions('ab=\\{')).toEqual({ ab: '\\{' }); + expect(ParseUtil.keyvalOptions('ab={a\\{b}')).toEqual({ ab: 'a\\{b' }); + expect(ParseUtil.keyvalOptions('ab=\\')).toEqual({ ab: '\\' }); + expect(ParseUtil.keyvalOptions('a\\b=c')).toEqual({ 'a\\b': 'c' }); }); test('keyValue braces', () => { - expect(ParseUtil.keyvalOptions('ab={{{cd} ef}}')).toEqual({ab: '{cd} ef'}); - expect(ParseUtil.keyvalOptions('ab={{{cd} ef}}', null, false, true)).toEqual({ab: '{{cd} ef}'}); - expect(ParseUtil.keyvalOptions('ab={x,y=z}')).toEqual({ab: 'x,y=z'}); + expect(ParseUtil.keyvalOptions('ab={{{cd} ef}}')).toEqual({ + ab: '{cd} ef', + }); + expect( + ParseUtil.keyvalOptions('ab={{{cd} ef}}', null, false, true) + ).toEqual({ ab: '{{cd} ef}' }); + expect(ParseUtil.keyvalOptions('ab={x,y=z}')).toEqual({ ab: 'x,y=z' }); }); test('keyValue extra open brace', () => { @@ -398,31 +428,49 @@ describe('ParseUtil', () => { }); test('keyValue allowed values', () => { - expect(ParseUtil.keyvalOptions('ab', {ab: 1})).toEqual({ab: true}); - expect(ParseUtil.keyvalOptions('ab', {abc: 1})).toEqual({}); - expect(ParseUtil.keyvalOptions('ab', {ab: KeyValueTypes.boolean})).toEqual({ab: true}); - expect(ParseUtil.keyvalOptions('ab=true', {ab: KeyValueTypes.boolean})).toEqual({ab: true}); - expect(ParseUtil.keyvalOptions('ab=1.2', {ab: KeyValueTypes.number})).toEqual({ab: 1.2}); - expect(ParseUtil.keyvalOptions('ab=12', {ab: KeyValueTypes.integer})).toEqual({ab: 12}); - expect(ParseUtil.keyvalOptions('ab=xy', {ab: KeyValueTypes.string})).toEqual({ab: 'xy'}); - expect(ParseUtil.keyvalOptions('ab=x', {ab: KeyValueDef.oneof('x','y')})).toEqual({ab: 'x'}); - expect(ParseUtil.keyvalOptions('ab=y', {ab: KeyValueDef.oneof('x','y')})).toEqual({ab: 'y'}); - expect(ParseUtil.keyvalOptions('ab=2em', {ab: KeyValueTypes.dimen})).toEqual({ab: '2em'}); + expect(ParseUtil.keyvalOptions('ab', { ab: 1 })).toEqual({ ab: true }); + expect(ParseUtil.keyvalOptions('ab', { abc: 1 })).toEqual({}); + expect( + ParseUtil.keyvalOptions('ab', { ab: KeyValueTypes.boolean }) + ).toEqual({ ab: true }); + expect( + ParseUtil.keyvalOptions('ab=true', { ab: KeyValueTypes.boolean }) + ).toEqual({ ab: true }); + expect( + ParseUtil.keyvalOptions('ab=1.2', { ab: KeyValueTypes.number }) + ).toEqual({ ab: 1.2 }); + expect( + ParseUtil.keyvalOptions('ab=12', { ab: KeyValueTypes.integer }) + ).toEqual({ ab: 12 }); + expect( + ParseUtil.keyvalOptions('ab=xy', { ab: KeyValueTypes.string }) + ).toEqual({ ab: 'xy' }); + expect( + ParseUtil.keyvalOptions('ab=x', { ab: KeyValueDef.oneof('x', 'y') }) + ).toEqual({ ab: 'x' }); + expect( + ParseUtil.keyvalOptions('ab=y', { ab: KeyValueDef.oneof('x', 'y') }) + ).toEqual({ ab: 'y' }); + expect( + ParseUtil.keyvalOptions('ab=2em', { ab: KeyValueTypes.dimen }) + ).toEqual({ ab: '2em' }); }); test('keyValue allowed with errors', () => { function trap(test: string, allow: any) { - return expect(trapErrors(() => ParseUtil.keyvalOptions(test, allow, true))); + return expect( + trapErrors(() => ParseUtil.keyvalOptions(test, allow, true)) + ); } const error = "Value for key 'ab' is not of the expected type"; - trap('ab', {abc: 1}).toBe('Invalid option: ab'); - trap('ab=x', {ab: KeyValueTypes.boolean}).toBe(error); - trap('ab=x', {ab: KeyValueTypes.number}).toBe(error); - trap('ab=1.2', {ab: KeyValueTypes.integer}).toBe(error); - trap('ab=', {ab: KeyValueTypes.string}).toBe('(no error)'); - trap('ab=z', {ab: KeyValueDef.oneof('x','y')}).toBe(error); - trap('ab=2xy', {ab: KeyValueTypes.dimen}).toBe(error); - trap('ab=2', {ab: KeyValueTypes.dimen}).toBe(error); + trap('ab', { abc: 1 }).toBe('Invalid option: ab'); + trap('ab=x', { ab: KeyValueTypes.boolean }).toBe(error); + trap('ab=x', { ab: KeyValueTypes.number }).toBe(error); + trap('ab=1.2', { ab: KeyValueTypes.integer }).toBe(error); + trap('ab=', { ab: KeyValueTypes.string }).toBe('(no error)'); + trap('ab=z', { ab: KeyValueDef.oneof('x', 'y') }).toBe(error); + trap('ab=2xy', { ab: KeyValueTypes.dimen }).toBe(error); + trap('ab=2', { ab: KeyValueTypes.dimen }).toBe(error); }); test('fixedFence', () => { @@ -434,29 +482,26 @@ describe('ParseUtil', () => { const kinds = mml.childNodes.map((node) => node.kind); expect(kinds).toEqual(['MathChoice', 'mi', 'MathChoice']); }); - }); /**********************************************************************************/ describe('ColumnParser', () => { - test('Error', () => { new CommandMap('cError', { cError(parser: any) { const array = parser.itemFactory.create('array'); parser.configuration.columnParser.process(parser, '@{x', array); - } + }, }); Configuration.create('cError', { [ConfigurationType.HANDLER]: { - [HandlerType.MACRO]: ['cError'] - } + [HandlerType.MACRO]: ['cError'], + }, }); setupTex(['base', 'cError']); expectTexError('\\cError').toBe('Missing close brace'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/TexHtml.test.ts b/testsuite/tests/input/tex/TexHtml.test.ts index a5e8015cc..01416c1fd 100644 --- a/testsuite/tests/input/tex/TexHtml.test.ts +++ b/testsuite/tests/input/tex/TexHtml.test.ts @@ -5,26 +5,35 @@ import { setupTexRender, tex2mml, render2mml, - expectTexError + expectTexError, } from '#helpers'; import '#js/input/tex/texhtml/TexHtmlConfiguration'; /**********************************************************************************/ describe('Texhtml', () => { - - beforeEach(() => setupTexRender(['base', 'texhtml'], {allowTexHTML: true})); + beforeEach(() => setupTexRender(['base', 'texhtml'], { allowTexHTML: true })); test('Html', () => { - expect(render2mml('x + bold + y')).toMatchSnapshot(); + expect( + render2mml('x + bold + y') + ).toMatchSnapshot(); }); test('Html multiple', () => { - expect(render2mml('x + bold + italicy')).toMatchSnapshot(); + expect( + render2mml( + 'x + bold + italicy' + ) + ).toMatchSnapshot(); }); test('Html nested', () => { - expect(render2mml('x + bold and html + y')).toMatchSnapshot(); + expect( + render2mml( + 'x + bold and html + y' + ) + ).toMatchSnapshot(); }); test('Html empty tag', () => { @@ -34,32 +43,28 @@ describe('Texhtml', () => { test('Html no tag', () => { expect(render2mml('x < y')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Texhtml error', () => { - - beforeEach(() => setupTex(['base', 'texhtml'], {allowTexHTML: true})); + beforeEach(() => setupTex(['base', 'texhtml'], { allowTexHTML: true })); test('Html missing comment tag', () => { - expectTexError('x + bold + y') - .toBe('Could not find for '); + expectTexError('x + bold + y').toBe( + 'Could not find for ' + ); }); - }); /**********************************************************************************/ describe('Texhtml not enabled', () => { - - beforeEach(() => setupTex(['base', 'texhtml'], {allowTexHTML: false})); + beforeEach(() => setupTex(['base', 'texhtml'], { allowTexHTML: false })); test('Html not allowed', () => { expect(tex2mml('x + a + y')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Textcomp.test.ts b/testsuite/tests/input/tex/Textcomp.test.ts index c30767236..8430e525c 100644 --- a/testsuite/tests/input/tex/Textcomp.test.ts +++ b/testsuite/tests/input/tex/Textcomp.test.ts @@ -8,7 +8,6 @@ beforeEach(() => setupTex(['base', 'textcomp'])); /**********************************************************************************/ describe('Textcomp', () => { - test('textasciicircum', () => { expect(tex2mml('\\textasciicircum')).toMatchSnapshot(); }); @@ -428,7 +427,6 @@ describe('Textcomp', () => { test('textmarried', () => { expect(tex2mml('\\textmarried')).toMatchSnapshot(); }); - }); /**********************************************************************************/ @@ -487,7 +485,6 @@ describe('Textcompwith Textmacros', () => { test('textnineoldstyle', () => { expect(tex2mml('\\text{\\textnineoldstyle}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Textmacros.test.ts b/testsuite/tests/input/tex/Textmacros.test.ts index e0a78619a..86f5de5dc 100644 --- a/testsuite/tests/input/tex/Textmacros.test.ts +++ b/testsuite/tests/input/tex/Textmacros.test.ts @@ -7,7 +7,7 @@ import { typeset2mml, setupComponents, expectTexError, - expectTypesetError + expectTypesetError, } from '#helpers'; import '#js/input/tex/textmacros/TextMacrosConfiguration'; import '#js/input/tex/newcommand/NewcommandConfiguration'; @@ -15,13 +15,12 @@ import '#js/input/tex/color/ColorConfiguration'; import '#js/input/tex/html/HtmlConfiguration'; import '#js/input/tex/unicode/UnicodeConfiguration'; -import {Configuration} from '#js/input/tex/Configuration.js'; -import {HandlerType, ConfigurationType} from '#js/input/tex/HandlerTypes.js'; +import { Configuration } from '#js/input/tex/Configuration.js'; +import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js'; /**********************************************************************************/ describe('Textmacros', () => { - beforeEach(() => setupTex(['base', 'newcommand', 'color', 'textmacros'])); test('Text plain', () => { @@ -33,8 +32,7 @@ describe('Textmacros', () => { }); test('Text unknown macro', () => { - expectTexError('\\text{\\xyz}') - .toBe('Undefined control sequence \\xyz'); + expectTexError('\\text{\\xyz}').toBe('Undefined control sequence \\xyz'); }); test('Text substitution macro', () => { @@ -42,8 +40,9 @@ describe('Textmacros', () => { }); test('Text mathmode macro', () => { - expectTexError('\\text{\\frac{1}{2}}') - .toBe('\\frac is only supported in math mode'); + expectTexError('\\text{\\frac{1}{2}}').toBe( + '\\frac is only supported in math mode' + ); }); test('Text internal math', () => { @@ -79,26 +78,27 @@ describe('Textmacros', () => { }); test('Unbalanced Braces', () => { - expectTexError('\\text{a ${$ b }}') - .toBe('Math mode is not properly terminated'); + expectTexError('\\text{a ${$ b }}').toBe( + 'Math mode is not properly terminated' + ); }); test('Unbalanced Braces', () => { - expectTexError('\\text{{a $}$ b }') - .toBe('Extra close brace or missing open brace'); + expectTexError('\\text{{a $}$ b }').toBe( + 'Extra close brace or missing open brace' + ); }); test('Unbalanced Braces', () => { - expectTexError('\\let\\x=}\\text{a \\x}') - .toBe('Extra close brace or missing open brace'); + expectTexError('\\let\\x=}\\text{a \\x}').toBe( + 'Extra close brace or missing open brace' + ); }); - }); /**********************************************************************************/ describe('Textmacros Specials', () => { - beforeEach(() => setupTex(['base', 'textmacros'])); test('Dollar', () => { @@ -140,14 +140,14 @@ describe('Textmacros Specials', () => { test('Quotes', () => { expect(tex2mml("\\text{a ``b'' `c' d}")).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Textmacros Macros', () => { - - beforeEach(() => setupTex(['base', 'newcommand', 'color', 'html', 'unicode', 'textmacros'])); + beforeEach(() => + setupTex(['base', 'newcommand', 'color', 'html', 'unicode', 'textmacros']) + ); test('Internal Math', () => { expect(tex2mml('\\text{a\\(b\\)}')).toMatchSnapshot(); @@ -162,7 +162,11 @@ describe('Textmacros Macros', () => { }); test('Accents', () => { - expect(tex2mml("\\text{\\'a\\\u2019a\\`a\\\u2018a\\^a\\\"a\\~a\\=a\\.a\\u a\\v a}")).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\\'a\\\u2019a\\`a\\\u2018a\\^a\\"a\\~a\\=a\\.a\\u a\\v a}' + ) + ).toMatchSnapshot(); }); test('emph', () => { @@ -210,19 +214,31 @@ describe('Textmacros Macros', () => { }); test('Sizes small', () => { - expect(tex2mml('\\text{{\\tiny a\\Tiny a \\scriptsize a \\small a\\normalsize a}a}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{{\\tiny a\\Tiny a \\scriptsize a \\small a\\normalsize a}a}' + ) + ).toMatchSnapshot(); }); test('Sizes large', () => { - expect(tex2mml('\\text{a\\large a\\Large a\\LARGE a\\huge a\\Huge a}')).toMatchSnapshot(); + expect( + tex2mml('\\text{a\\large a\\Large a\\LARGE a\\huge a\\Huge a}') + ).toMatchSnapshot(); }); test('Text fonts', () => { - expect(tex2mml('\\text{\\Bbb a\\textnormal{a}\\textup{a}\\textrm{a}\\textit{a}\\textbf{a}\\textsf{a}\\texttt{a}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\Bbb a\\textnormal{a}\\textup{a}\\textrm{a}\\textit{a}\\textbf{a}\\textsf{a}\\texttt{a}}' + ) + ).toMatchSnapshot(); }); test('Text symbols', () => { - expect(tex2mml('\\text{\\dagger\\ddagger\\S\\AA a\\ldots b\\vdots c}')).toMatchSnapshot(); + expect( + tex2mml('\\text{\\dagger\\ddagger\\S\\AA a\\ldots b\\vdots c}') + ).toMatchSnapshot(); }); test('Text space macros 1', () => { @@ -230,27 +246,49 @@ describe('Textmacros Macros', () => { }); test('Text space macros 2', () => { - expect(tex2mml('\\text{a\\enspace b\\quad c\\qquad d\\thinspace e\\negthinspace f}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{a\\enspace b\\quad c\\qquad d\\thinspace e\\negthinspace f}' + ) + ).toMatchSnapshot(); }); test('Text spacing macros', () => { - expect(tex2mml('\\text{a\\hskip 1emb\\hspace{1em}c\\kern{.1em}d\\mskip{1em}e\\mspace{1em}f\\mkern{.1em}g}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{a\\hskip 1emb\\hspace{1em}c\\kern{.1em}d\\mskip{1em}e\\mspace{1em}f\\mkern{.1em}g}' + ) + ).toMatchSnapshot(); }); test('Text rules and spaces', () => { - expect(tex2mml('\\text{\\Rule{1em}{.5em}{.5em}\\Space{1em}{.5em}{0em}\\rule[.25em]{1em}{.5em}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\Rule{1em}{.5em}{.5em}\\Space{1em}{.5em}{0em}\\rule[.25em]{1em}{.5em}}' + ) + ).toMatchSnapshot(); }); test('Color', () => { - expect(tex2mml('\\text{{\\color{red}{x}}\\textcolor{yellow}{A}\\colorbox{green}{x}\\fcolorbox{blue}{orange}{x}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{{\\color{red}{x}}\\textcolor{yellow}{A}\\colorbox{green}{x}\\fcolorbox{blue}{orange}{x}}' + ) + ).toMatchSnapshot(); }); test('HTML', () => { - expect(tex2mml('\\text{\\href{tmp.html}{x}\\style{padding:3px}{x}\\class{test}{x}\\data{test=1}{x}\\cssId{test}{x}}')).toMatchSnapshot(); + expect( + tex2mml( + '\\text{\\href{tmp.html}{x}\\style{padding:3px}{x}\\class{test}{x}\\data{test=1}{x}\\cssId{test}{x}}' + ) + ).toMatchSnapshot(); }); test('Unicode', () => { - expect(tex2mml('\\text{\\unicode{x61}\\U{3333}\\char"65}')).toMatchSnapshot(); + expect( + tex2mml('\\text{\\unicode{x61}\\U{3333}\\char"65}') + ).toMatchSnapshot(); }); test('Ref and Eqref', () => { @@ -266,46 +304,44 @@ describe('Textmacros Macros', () => { }); test('Phantoms', () => { - expect(tex2mml('\\text{\\phantom{a}a\\vphantom{a}a\\hphantom{a}a\\smash{a}}')).toMatchSnapshot(); + expect( + tex2mml('\\text{\\phantom{a}a\\vphantom{a}a\\hphantom{a}a\\smash{a}}') + ).toMatchSnapshot(); }); test('mmlToken', () => { expect(tex2mml('\\text{\\mmlToken{mo}{a}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Textmacros Autoload', () => { - setupComponents({ - loader: {load: ['input/tex-base', '[tex]/textmacros', '[tex]/autoload']} + loader: { load: ['input/tex-base', '[tex]/textmacros', '[tex]/autoload'] }, }); test('Autoload not present', async () => { setupTexTypeset(['base', 'textmacros']); - await expectTypesetError('\\text{\\href{tmp.html}{a}}') - .toBe('Undefined control sequence \\href'); + await expectTypesetError('\\text{\\href{tmp.html}{a}}').toBe( + 'Undefined control sequence \\href' + ); }); test('Autoload', async () => { - setupTexTypeset(['base', 'textmacros', 'autoload']) - expect( - await typeset2mml('\\text{\\href{tmp.html}{a}}')).toMatchSnapshot(); + setupTexTypeset(['base', 'textmacros', 'autoload']); + expect(await typeset2mml('\\text{\\href{tmp.html}{a}}')).toMatchSnapshot(); }); test('No Autoload', async () => { Configuration.create('no-autoload', { [ConfigurationType.FALLBACK]: { - [HandlerType.MACRO]: () => {} - } + [HandlerType.MACRO]: () => {}, + }, }); - setupTexTypeset(['base', 'textmacros', 'no-autoload']) - expect( - await typeset2mml('\\text{\\href{tmp.html}{a}}')).toMatchSnapshot(); + setupTexTypeset(['base', 'textmacros', 'no-autoload']); + expect(await typeset2mml('\\text{\\href{tmp.html}{a}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Unicode.test.ts b/testsuite/tests/input/tex/Unicode.test.ts index ca4bf1d39..e8e759a4b 100644 --- a/testsuite/tests/input/tex/Unicode.test.ts +++ b/testsuite/tests/input/tex/Unicode.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'unicode'])); /**********************************************************************************/ describe('Unicode', () => { - it('Unicode Dec', () => { expect(tex2mml('\\unicode{8922}')).toMatchSnapshot(); }); @@ -55,14 +54,12 @@ describe('Unicode', () => { it('Unicode Blackboard Geramond', () => { expect(tex2mml('\\unicode{x1D538}')).toMatchSnapshot(); }); - }); // Here the order is important! As otherwise bold stays. /**********************************************************************************/ describe('Unicode Complete', () => { - it('Unicode Caligraphic', () => { expect(tex2mml('\\mathtt{\\unicode{8922}}')).toMatchSnapshot(); }); @@ -74,19 +71,17 @@ describe('Unicode Complete', () => { it('Unicode Italic', () => { expect(tex2mml('\\mathit{\\unicode[bold]{8922}}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Unicode others', () => { - it('Raw Unicode', () => { expect(tex2mml('\\U{892F}')).toMatchSnapshot(); }); it('Char numerical', () => { - expect(tex2mml('\\char\'777')).toMatchSnapshot(); + expect(tex2mml("\\char'777")).toMatchSnapshot(); }); it('Char alpha', () => { @@ -104,38 +99,38 @@ describe('Unicode others', () => { it('Char number', () => { expect(tex2mml('\\char55')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Unicode Errors', () => { - it('Unicode BadFont', () => { - expectTexError('\\unicode[arial;]{8922}') - .toBe("Font name for \\unicode can't contain semicolons"); + expectTexError('\\unicode[arial;]{8922}').toBe( + "Font name for \\unicode can't contain semicolons" + ); }); it('Unicode BadUnicode', () => { - expectTexError('\\unicode{4A}') - .toBe('Argument to \\unicode must be a number'); + expectTexError('\\unicode{4A}').toBe( + 'Argument to \\unicode must be a number' + ); }); it('Unicode BadRawUnicode', () => { - expectTexError('\\U{892G}') - .toBe('Argument to \\U must a hexadecimal number with 1 to 6 digits'); + expectTexError('\\U{892G}').toBe( + 'Argument to \\U must a hexadecimal number with 1 to 6 digits' + ); }); it('Unicode InvalidAlphanumeric', () => { - expectTexError('\\char`\\nix') - .toBe('Invalid alphanumeric constant for \\char'); + expectTexError('\\char`\\nix').toBe( + 'Invalid alphanumeric constant for \\char' + ); }); it('Unicode MissingNumber', () => { - expectTexError('\\char {40}') - .toBe('Missing numeric constant for \\char'); + expectTexError('\\char {40}').toBe('Missing numeric constant for \\char'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/UnitUtil.test.ts b/testsuite/tests/input/tex/UnitUtil.test.ts index 73bb14c83..3774084d7 100644 --- a/testsuite/tests/input/tex/UnitUtil.test.ts +++ b/testsuite/tests/input/tex/UnitUtil.test.ts @@ -77,7 +77,8 @@ describe('Dimension matching', () => { it('10mm', () => expect(matchDimension('10mm')).toEqual(['10', 'mm', 4])); it('9mu', () => expect(matchDimension('9mu')).toEqual(['0.5', 'em', 3])); it('10mu', () => expect(matchDimension('10mu')).toEqual(['0.556', 'em', 4])); - it('rest', () => expect(UnitUtil.matchDimen('9em rest', true)).toEqual(['9', 'em', 4])); + it('rest', () => + expect(UnitUtil.matchDimen('9em rest', true)).toEqual(['9', 'em', 4])); }); /**********************************************************************************/ @@ -124,9 +125,11 @@ describe('Remove Unit', () => { /**********************************************************************************/ describe('Trim spaces', () => { - it('removes spaces and tabs', () => expect(UnitUtil.trimSpaces(' \t abc \t ')).toBe('abc')); + it('removes spaces and tabs', () => + expect(UnitUtil.trimSpaces(' \t abc \t ')).toBe('abc')); it('non-text argument', () => expect(UnitUtil.trimSpaces(null)).toBe(null)); - it('space macro at end', () => expect(UnitUtil.trimSpaces('\\ ')).toBe('\\ ')); + it('space macro at end', () => + expect(UnitUtil.trimSpaces('\\ ')).toBe('\\ ')); }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Units.test.ts b/testsuite/tests/input/tex/Units.test.ts index f421a99b2..78a18df0f 100644 --- a/testsuite/tests/input/tex/Units.test.ts +++ b/testsuite/tests/input/tex/Units.test.ts @@ -5,7 +5,6 @@ import '#js/input/tex/units/UnitsConfiguration'; /**********************************************************************************/ describe('Units', () => { - beforeEach(() => setupTex(['base', 'units'])); test('Unit', () => { @@ -35,14 +34,14 @@ describe('Units', () => { test('Nicefrac with font', () => { expect(tex2mml('\\nicefrac[\\mathsf]{1}{2}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ describe('Units loose ugly', () => { - - beforeEach(() => setupTex(['base', 'units'], {units: {loose: true, ugly: true}})); + beforeEach(() => + setupTex(['base', 'units'], { units: { loose: true, ugly: true } }) + ); test('Unit with value', () => { expect(tex2mml('\\units[5]{kg}')).toMatchSnapshot(); @@ -55,7 +54,6 @@ describe('Units loose ugly', () => { test('nicefrac', () => { expect(tex2mml('\\nicefrac{1}{2}')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Upgreek.test.ts b/testsuite/tests/input/tex/Upgreek.test.ts index baffe59f7..2b29fe494 100644 --- a/testsuite/tests/input/tex/Upgreek.test.ts +++ b/testsuite/tests/input/tex/Upgreek.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'upgreek'])); /**********************************************************************************/ describe('Upgreek', () => { - test('upalpha', () => { expect(tex2mml('\\upalpha')).toMatchSnapshot(); }); @@ -171,7 +170,6 @@ describe('Upgreek', () => { test('Upomega', () => { expect(tex2mml('\\Upomega')).toMatchSnapshot(); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/input/tex/Verb.test.ts b/testsuite/tests/input/tex/Verb.test.ts index 1fc4def3b..e1e00a168 100644 --- a/testsuite/tests/input/tex/Verb.test.ts +++ b/testsuite/tests/input/tex/Verb.test.ts @@ -7,7 +7,6 @@ beforeEach(() => setupTex(['base', 'verb'])); /**********************************************************************************/ describe('Verb', () => { - it('Verb Plus ', () => { expect(tex2mml('\\verb+{a}+')).toMatchSnapshot(); }); @@ -29,13 +28,12 @@ describe('Verb', () => { }); it('Verb Error', () => { - expectTexError('\\verb{a}').toBe('Can\'t find closing delimiter for \\verb'); + expectTexError('\\verb{a}').toBe("Can't find closing delimiter for \\verb"); }); it('Verb Missing Arg', () => { expectTexError('\\verb').toBe('Missing argument for \\verb'); }); - }); /**********************************************************************************/ diff --git a/testsuite/tests/util/AsyncLoad.test.ts b/testsuite/tests/util/AsyncLoad.test.ts index 9e3fe19a3..93c1395fc 100644 --- a/testsuite/tests/util/AsyncLoad.test.ts +++ b/testsuite/tests/util/AsyncLoad.test.ts @@ -1,14 +1,17 @@ import { describe, test, expect } from '@jest/globals'; -import {asyncLoad} from '#js/util/AsyncLoad.js'; -import {mathjax} from '#js/mathjax.js'; +import { asyncLoad } from '#js/util/AsyncLoad.js'; +import { mathjax } from '#js/mathjax.js'; describe('asyncLoad()', () => { - test('asyncLoad()', async () => { // // Throws error if not set in mathjax // - expect(asyncLoad('x.js').then(() => false).catch(() => true)).resolves.toBe(true); + expect( + asyncLoad('x.js') + .then(() => false) + .catch(() => true) + ).resolves.toBe(true); // // mathjax.asyncLoad returns value @@ -19,21 +22,25 @@ describe('asyncLoad()', () => { // // mathjax.asyncLoad throws error // - mathjax.asyncLoad = (_name: string) => {throw 'fail'}; + mathjax.asyncLoad = (_name: string) => { + throw 'fail'; + }; await expect(asyncLoad('x.js')).rejects.toBe('fail'); // // mathjax.asyncLoad returns promise // - mathjax.asyncLoad = (_name: string) => Promise.resolve().then(() => 'success'); + mathjax.asyncLoad = (_name: string) => + Promise.resolve().then(() => 'success'); await expect(asyncLoad('x.js')).resolves.toBe('success'); // // mathjax.asyncLoad returns promise that rejects // - mathjax.asyncLoad = (_name: string) => Promise.reject().catch(() => {throw 'fail'}); + mathjax.asyncLoad = (_name: string) => + Promise.reject().catch(() => { + throw 'fail'; + }); await expect(asyncLoad('x.js')).rejects.toBe('fail'); - }); - }); diff --git a/testsuite/tests/util/BBox.test.ts b/testsuite/tests/util/BBox.test.ts index 686649eb0..525aefb26 100644 --- a/testsuite/tests/util/BBox.test.ts +++ b/testsuite/tests/util/BBox.test.ts @@ -1,47 +1,64 @@ import { describe, test, expect } from '@jest/globals'; -import {BBox} from '#js/util/BBox.js'; -import {BIGDIMEN} from '#js/util/lengths.js'; +import { BBox } from '#js/util/BBox.js'; +import { BIGDIMEN } from '#js/util/lengths.js'; describe('BBox object', () => { - test('BBox creation', () => { - expect(BBox.zero()).toEqual(expect.objectContaining({w: 0, h: 0, d: 0})); - expect(BBox.empty()).toEqual(expect.objectContaining({w: 0, h: -BIGDIMEN, d: -BIGDIMEN})); - expect(new BBox({w: 1, h: 2, d: 0})).toEqual({ - w: 1, h: 2, d: 0, - L: 0, R: 0, - ic: 0, oc: 0, sk: 0, dx: 0, - scale: 1, rscale: 1, - pwidth: '' + expect(BBox.zero()).toEqual(expect.objectContaining({ w: 0, h: 0, d: 0 })); + expect(BBox.empty()).toEqual( + expect.objectContaining({ w: 0, h: -BIGDIMEN, d: -BIGDIMEN }) + ); + expect(new BBox({ w: 1, h: 2, d: 0 })).toEqual({ + w: 1, + h: 2, + d: 0, + L: 0, + R: 0, + ic: 0, + oc: 0, + sk: 0, + dx: 0, + scale: 1, + rscale: 1, + pwidth: '', }); - expect(new BBox({w: 1})).toEqual(expect.objectContaining({w: 1, h: -BIGDIMEN, d: -BIGDIMEN})); + expect(new BBox({ w: 1 })).toEqual( + expect.objectContaining({ w: 1, h: -BIGDIMEN, d: -BIGDIMEN }) + ); }); test('empty()', () => { - expect(BBox.zero().empty()).toEqual(expect.objectContaining({w: 0, h: -BIGDIMEN, d: -BIGDIMEN})); + expect(BBox.zero().empty()).toEqual( + expect.objectContaining({ w: 0, h: -BIGDIMEN, d: -BIGDIMEN }) + ); }); test('clean()', () => { const bbox = BBox.empty(); bbox.w = -BIGDIMEN; bbox.clean(); - expect(bbox).toEqual(expect.objectContaining({w: 0, h: 0, d: 0})); + expect(bbox).toEqual(expect.objectContaining({ w: 0, h: 0, d: 0 })); }); test('rescale()', () => { - const bbox = new BBox({w: 1, h: 2, d: 3}); + const bbox = new BBox({ w: 1, h: 2, d: 3 }); bbox.rescale(2); - expect(bbox).toEqual(expect.objectContaining({w: 2, h: 4, d: 6})); + expect(bbox).toEqual(expect.objectContaining({ w: 2, h: 4, d: 6 })); bbox.rescale(0); expect(bbox).toEqual(BBox.zero()); }); test('copy()', () => { - const bbox = Object.assign(new BBox({w: 1, h: 2, d: 3}), { - L: 4, R: 5, - ic: 6, oc: 7, sk: 8, dx: 9, - scale: 10, rscale: 11, - pwidth: '10%' + const bbox = Object.assign(new BBox({ w: 1, h: 2, d: 3 }), { + L: 4, + R: 5, + ic: 6, + oc: 7, + sk: 8, + dx: 9, + scale: 10, + rscale: 11, + pwidth: '10%', }); const copy = bbox.copy(); expect(copy).toEqual(bbox); @@ -49,44 +66,63 @@ describe('BBox object', () => { }); test('updateFrom()', () => { - const bbox1 = Object.assign(new BBox({w: 1, h: 2, d: 3}), { - L: 4, R: 5, - ic: 6, oc: 7, sk: 8, dx: 9, - scale: 10, rscale: 11, - pwidth: '' + const bbox1 = Object.assign(new BBox({ w: 1, h: 2, d: 3 }), { + L: 4, + R: 5, + ic: 6, + oc: 7, + sk: 8, + dx: 9, + scale: 10, + rscale: 11, + pwidth: '', }); bbox1.updateFrom(BBox.empty()); expect(bbox1).toEqual({ - w: 0, h: -BIGDIMEN, d: -BIGDIMEN, - L: 4, R: 5, - ic: 6, oc: 7, sk: 8, dx: 9, - scale: 10, rscale: 11, - pwidth: '' + w: 0, + h: -BIGDIMEN, + d: -BIGDIMEN, + L: 4, + R: 5, + ic: 6, + oc: 7, + sk: 8, + dx: 9, + scale: 10, + rscale: 11, + pwidth: '', }); bbox1.pwidth = '100%'; const bbox2 = BBox.zero(); bbox2.updateFrom(bbox1); expect(bbox2).toEqual({ - w: 0, h: -BIGDIMEN, d: -BIGDIMEN, - L: 0, R: 0, - ic: 0, oc: 0, sk: 0, dx: 0, - scale: 1, rscale: 1, - pwidth: '100%' + w: 0, + h: -BIGDIMEN, + d: -BIGDIMEN, + L: 0, + R: 0, + ic: 0, + oc: 0, + sk: 0, + dx: 0, + scale: 1, + rscale: 1, + pwidth: '100%', }); }); test('combine()', () => { let bbox = BBox.empty(); - const cbox = new BBox({w: 1, h: 2, d: 3}); + const cbox = new BBox({ w: 1, h: 2, d: 3 }); bbox.combine(cbox); - expect(bbox).toEqual(expect.objectContaining({w: 1, h: 2, d: 3})); + expect(bbox).toEqual(expect.objectContaining({ w: 1, h: 2, d: 3 })); // // Check that a scaled bbox is placed properly // cbox.rscale = 2; bbox.combine(cbox); - expect(bbox).toEqual(expect.objectContaining({w: 2, h: 4, d: 6})); + expect(bbox).toEqual(expect.objectContaining({ w: 2, h: 4, d: 6 })); // // Check x and y positioning @@ -94,37 +130,36 @@ describe('BBox object', () => { bbox = BBox.empty(); cbox.L = 2; cbox.R = 1; - cbox.rscale = .5; + cbox.rscale = 0.5; bbox.combine(cbox, 1, 2); - expect(bbox).toEqual(expect.objectContaining({w: 3, h: 3, d: -.5})); + expect(bbox).toEqual(expect.objectContaining({ w: 3, h: 3, d: -0.5 })); // // Check box that doesn't change current bbox // - cbox.rscale = .01; + cbox.rscale = 0.01; bbox.combine(cbox, 1, 1); - expect(bbox).toEqual(expect.objectContaining({w: 3, h: 3, d: -.5})); + expect(bbox).toEqual(expect.objectContaining({ w: 3, h: 3, d: -0.5 })); }); test('append()', () => { - let bbox = BBox.empty(); - const cbox = new BBox({w: 1, h: 2, d: 3}); + const bbox = BBox.empty(); + const cbox = new BBox({ w: 1, h: 2, d: 3 }); bbox.append(cbox); - expect(bbox).toEqual(expect.objectContaining({w: 1, h: 2, d: 3})); + expect(bbox).toEqual(expect.objectContaining({ w: 1, h: 2, d: 3 })); // // Check that a scaled bbox is placed properly // cbox.rscale = 2; bbox.append(cbox); - expect(bbox).toEqual(expect.objectContaining({w: 3, h: 4, d: 6})); + expect(bbox).toEqual(expect.objectContaining({ w: 3, h: 4, d: 6 })); // // Check that h and d don't change // cbox.rscale = 1; bbox.append(cbox); - expect(bbox).toEqual(expect.objectContaining({w: 4, h: 4, d: 6})); + expect(bbox).toEqual(expect.objectContaining({ w: 4, h: 4, d: 6 })); }); - }); diff --git a/testsuite/tests/util/BitField.test.ts b/testsuite/tests/util/BitField.test.ts index 25a6f8694..615259502 100644 --- a/testsuite/tests/util/BitField.test.ts +++ b/testsuite/tests/util/BitField.test.ts @@ -1,5 +1,5 @@ import { describe, test, expect } from '@jest/globals'; -import {BitField, BitFieldClass} from '#js/util/BitField.js'; +import { BitField, BitFieldClass } from '#js/util/BitField.js'; const MAXBIT = (BitField as any).MAXBIT; @@ -7,7 +7,6 @@ const bitClass = BitFieldClass('a', 'b'); bitClass.allocate('c'); describe('BitField object', () => { - test('Allocating bits', () => { expect(bitClass.has('a')).toBe(true); expect(bitClass.has('b')).toBe(true); @@ -16,7 +15,9 @@ describe('BitField object', () => { for (let i = 1 << 3; i !== MAXBIT; i = i << 1) { bitClass.allocate('x' + i); } - expect(() => bitClass.allocate('y')).toThrow('Maximum number of bits already allocated'); + expect(() => bitClass.allocate('y')).toThrow( + 'Maximum number of bits already allocated' + ); }); test('set/clear/isSet/reset', () => { @@ -35,7 +36,7 @@ describe('BitField object', () => { // // Check that setting again is still set // - bits.set('a') + bits.set('a'); expect(bits.isSet('a')).toBe(true); // // Check that it clears @@ -62,5 +63,4 @@ describe('BitField object', () => { // expect(() => bits.isSet('A')).toThrow('Unknown bit-field name: A'); }); - }); diff --git a/testsuite/tests/util/Context-android.test.ts b/testsuite/tests/util/Context-android.test.ts index d95322bde..2ae0d72cd 100644 --- a/testsuite/tests/util/Context-android.test.ts +++ b/testsuite/tests/util/Context-android.test.ts @@ -1,16 +1,21 @@ import { describe, test, expect } from '@jest/globals'; -const window = {document: {}, navigator: {userAgent: 'Android', appVersion: ''}}; +const window = { + document: {}, + navigator: { userAgent: 'Android', appVersion: '' }, +}; (global as any).window = window; describe('context object', () => { - test('context', async () => { - let {context, hasWindow} = await import("#js/util/context.js"); + const { context, hasWindow } = await import('#js/util/context.js'); expect(context.path('C:\\test.js')).toBe('C:\\test.js'); delete context.path; - expect(context).toEqual({window: window, document: window.document, os: 'Unix'}); + expect(context).toEqual({ + window: window, + document: window.document, + os: 'Unix', + }); expect(hasWindow).toBe(true); }); - }); diff --git a/testsuite/tests/util/Context-browser.test.ts b/testsuite/tests/util/Context-browser.test.ts index 56e939fec..94e101f40 100644 --- a/testsuite/tests/util/Context-browser.test.ts +++ b/testsuite/tests/util/Context-browser.test.ts @@ -1,16 +1,18 @@ import { describe, test, expect } from '@jest/globals'; -const window = {document: {}, navigator: {appVersion: 'Linux'}}; +const window = { document: {}, navigator: { appVersion: 'Linux' } }; (global as any).window = window; describe('context object', () => { - test('context', async () => { - let {context, hasWindow} = await import("#js/util/context.js"); + const { context, hasWindow } = await import('#js/util/context.js'); expect(context.path('C:\\test.js')).toBe('C:\\test.js'); delete context.path; - expect(context).toEqual({window: window, document: window.document, os: 'Unix'}); + expect(context).toEqual({ + window: window, + document: window.document, + os: 'Unix', + }); expect(hasWindow).toBe(true); }); - }); diff --git a/testsuite/tests/util/Context-node-unknown.test.ts b/testsuite/tests/util/Context-node-unknown.test.ts index 094e5514f..fa8a615c1 100644 --- a/testsuite/tests/util/Context-node-unknown.test.ts +++ b/testsuite/tests/util/Context-node-unknown.test.ts @@ -1,15 +1,13 @@ import { describe, test, expect } from '@jest/globals'; -global.process = {...process, platform: 'test'} as any; +global.process = { ...process, platform: 'test' } as any; describe('context object', () => { - test('context', async () => { - let {context, hasWindow} = await import("#js/util/context.js"); + const { context, hasWindow } = await import('#js/util/context.js'); expect(context.path('C:\\test.js')).toBe('C:\\test.js'); delete context.path; - expect(context).toEqual({window: null, document: null, os: 'test'}); + expect(context).toEqual({ window: null, document: null, os: 'test' }); expect(hasWindow).toBe(false); }); - }); diff --git a/testsuite/tests/util/Context-node.test.ts b/testsuite/tests/util/Context-node.test.ts index a0bcc1564..9794115c9 100644 --- a/testsuite/tests/util/Context-node.test.ts +++ b/testsuite/tests/util/Context-node.test.ts @@ -1,22 +1,22 @@ import { describe, test, expect } from '@jest/globals'; import { context, hasWindow } from '#js/util/context.js'; -const OS = { - 'linux': 'Unix', - 'android': 'Unix', - 'aix': 'Unix', - 'freebsd': 'Unix', - 'netbsd': 'Unix', - 'openbsd': 'Unix', - 'sunos': 'Unix', - 'darwin': 'MacOS', - 'win32': 'Windows', - 'cygwin': 'Windows', - 'haiku': 'unknown', -}[process.platform] || process.platform; +const OS = + { + linux: 'Unix', + android: 'Unix', + aix: 'Unix', + freebsd: 'Unix', + netbsd: 'Unix', + openbsd: 'Unix', + sunos: 'Unix', + darwin: 'MacOS', + win32: 'Windows', + cygwin: 'Windows', + haiku: 'unknown', + }[process.platform] || process.platform; describe('context object', () => { - test('context', () => { if (OS === 'Windows') { expect(context.path('C:\\test.js')).toBe('file://C:/test.js'); @@ -24,8 +24,7 @@ describe('context object', () => { expect(context.path('C:\\test.js')).toBe('C:\\test.js'); } delete context.path; - expect(context).toEqual({window: null, document: null, os: OS}); + expect(context).toEqual({ window: null, document: null, os: OS }); expect(hasWindow).toBe(false); }); - }); diff --git a/testsuite/tests/util/Context-unknown.test.ts b/testsuite/tests/util/Context-unknown.test.ts index cc7ed9f63..8fe43526b 100644 --- a/testsuite/tests/util/Context-unknown.test.ts +++ b/testsuite/tests/util/Context-unknown.test.ts @@ -1,16 +1,18 @@ import { describe, test, expect } from '@jest/globals'; -const window = {document: {}, navigator: {userAgent: '', appVersion: ''}}; +const window = { document: {}, navigator: { userAgent: '', appVersion: '' } }; (global as any).window = window; describe('context object', () => { - test('context', async () => { - let {context, hasWindow} = await import("#js/util/context.js"); + const { context, hasWindow } = await import('#js/util/context.js'); expect(context.path('C:\\test.js')).toBe('C:\\test.js'); delete context.path; - expect(context).toEqual({window: window, document: window.document, os: 'unknown'}); + expect(context).toEqual({ + window: window, + document: window.document, + os: 'unknown', + }); expect(hasWindow).toBe(true); }); - }); diff --git a/testsuite/tests/util/Context-windows.test.ts b/testsuite/tests/util/Context-windows.test.ts index 68a6bbee8..aca92d7a5 100644 --- a/testsuite/tests/util/Context-windows.test.ts +++ b/testsuite/tests/util/Context-windows.test.ts @@ -1,19 +1,21 @@ import { describe, test, expect } from '@jest/globals'; -const window = {document: {}, navigator: {appVersion: 'Win'}}; +const window = { document: {}, navigator: { appVersion: 'Win' } }; (global as any).window = window; describe('context object', () => { - test('context', async () => { - let {context, hasWindow} = await import("#js/util/context.js"); + const { context, hasWindow } = await import('#js/util/context.js'); expect(context.path('C:\\test.js')).toBe('file://C:/test.js'); expect(context.path('/C:/test.js')).toBe('file://C:/test.js'); expect(context.path('/test.js')).toBe('file:///test.js'); expect(context.path('./test.js')).toBe('./test.js'); delete context.path; - expect(context).toEqual({window: window, document: window.document, os: 'Windows'}); + expect(context).toEqual({ + window: window, + document: window.document, + os: 'Windows', + }); expect(hasWindow).toBe(true); }); - }); diff --git a/testsuite/tests/util/Entities.test.ts b/testsuite/tests/util/Entities.test.ts index b06b5227c..49418fb0b 100644 --- a/testsuite/tests/util/Entities.test.ts +++ b/testsuite/tests/util/Entities.test.ts @@ -1,21 +1,25 @@ import { describe, test, expect } from '@jest/globals'; import * as Entities from '#js/util/Entities.js'; -import {handleRetriesFor} from '#js/util/Retries.js'; +import { handleRetriesFor } from '#js/util/Retries.js'; import '#js/util/asyncLoad/esm.js'; describe('Entities translation', () => { - test('translate()', async () => { expect(Entities.translate('a')).toBe('a'); expect(Entities.translate('a')).toBe('a'); expect(Entities.translate('&')).toBe('&'); - await expect(handleRetriesFor(() => Entities.translate('&xyz;'))).resolves.toBe('&xyz;'); // no such entity - await expect(handleRetriesFor(() => Entities.translate('≈'))).resolves.toBe('\u2248'); // load a.js - await expect(handleRetriesFor(() => Entities.translate('ℬ'))).resolves.toBe('\u212C'); // load scr.js + await expect( + handleRetriesFor(() => Entities.translate('&xyz;')) + ).resolves.toBe('&xyz;'); // no such entity + await expect( + handleRetriesFor(() => Entities.translate('≈')) + ).resolves.toBe('\u2248'); // load a.js + await expect( + handleRetriesFor(() => Entities.translate('ℬ')) + ).resolves.toBe('\u212C'); // load scr.js Entities.remove('approx'); - expect(Entities.translate('≈')).toBe('≈'); // undefined entities remain unchanged + expect(Entities.translate('≈')).toBe('≈'); // undefined entities remain unchanged Entities.options.loadMissingEntities = false; - expect(Entities.translate('⋀')).toBe('⋀'); // don't load b.js + expect(Entities.translate('⋀')).toBe('⋀'); // don't load b.js }); - }); diff --git a/testsuite/tests/util/FunctionList.test.ts b/testsuite/tests/util/FunctionList.test.ts index 901cb8d1b..3b0d91e42 100644 --- a/testsuite/tests/util/FunctionList.test.ts +++ b/testsuite/tests/util/FunctionList.test.ts @@ -1,5 +1,5 @@ import { describe, test, expect } from '@jest/globals'; -import {FunctionList, AnyFunction} from '#js/util/FunctionList.js'; +import { FunctionList, AnyFunction } from '#js/util/FunctionList.js'; // // Set up a function list with 6 functions that captures output @@ -7,7 +7,9 @@ import {FunctionList, AnyFunction} from '#js/util/FunctionList.js'; function LIST(): [FunctionList, string[]] { const output = [] as string[]; const list = new FunctionList(); - for (const i of [5, 0, 2, 1, 6, 3, 4]) {list.add(FN(i, output), i)} + for (const i of [5, 0, 2, 1, 6, 3, 4]) { + list.add(FN(i, output), i); + } return [list, output]; } @@ -23,7 +25,9 @@ function FN(i: number, output: string[] = []) { output.push(x === undefined ? String(i) : y == null ? x + i : x + y + i); if (x === 'delay' && i === 3) { return new Promise((ok, fail) => { - setTimeout(() => {y === 'fail' ? fail('Failed!') : ok()}, 10); + setTimeout(() => { + y === 'fail' ? fail('Failed!') : ok(); + }, 10); }); } return true; @@ -39,16 +43,19 @@ describe('FunctionList functionality', () => { const list = new FunctionList(); const fn = FN(0); const item = list.add(fn); - expect(Array.from(list)).toEqual([{item: item, priority: 5}]); + expect(Array.from(list)).toEqual([{ item: item, priority: 5 }]); expect(item).toBe(fn); }); test('Adding a list of items', () => { - const fns = [(_: any) => {}, [(_: any) => {}, 1]] as [AnyFunction, [AnyFunction, number]]; + const fns = [(_: any) => {}, [(_: any) => {}, 1]] as [ + AnyFunction, + [AnyFunction, number], + ]; const list = new FunctionList(fns); expect(Array.from(list)).toEqual([ - {item: fns[1][0], priority: 1}, - {item: fns[0], priority: 5}, + { item: fns[1][0], priority: 1 }, + { item: fns[0], priority: 5 }, ]); }); @@ -65,7 +72,7 @@ describe('FunctionList functionality', () => { const list = new FunctionList(); list.add(FN(0, output)); expect(list.execute()).toBe(true); - expect(output).toEqual(["0"]); + expect(output).toEqual(['0']); }); test('Sorting of list', () => { @@ -134,7 +141,7 @@ describe('FunctionList functionality', () => { expect.assertions(2); list.asyncExecute('fail').catch((err: Error) => { expect(output).toEqual(['fail0', 'fail1', 'fail2']); - expect(err.message).toBe("fail"); + expect(err.message).toBe('fail'); }); }); @@ -142,16 +149,28 @@ describe('FunctionList functionality', () => { const [list, output] = LIST(); list.asyncExecute('delay', '').then((result: boolean) => { expect(result).toBe(true); - expect(output).toEqual(['delay0', 'delay1', 'delay2', 'delay3', 'delay4', 'delay5', 'delay6']); + expect(output).toEqual([ + 'delay0', + 'delay1', + 'delay2', + 'delay3', + 'delay4', + 'delay5', + 'delay6', + ]); }); }); test('Failed promise in asyncExecute()', () => { const [list, output] = LIST(); list.asyncExecute('delay', 'fail').catch((result: string) => { - expect(output).toEqual(['delayfail0', 'delayfail1', 'delayfail2', 'delayfail3']); - expect(result).toBe("Failed!"); + expect(output).toEqual([ + 'delayfail0', + 'delayfail1', + 'delayfail2', + 'delayfail3', + ]); + expect(result).toBe('Failed!'); }); }); - }); diff --git a/testsuite/tests/util/LinkedList.test.ts b/testsuite/tests/util/LinkedList.test.ts index be0b01b77..0f16e32bf 100644 --- a/testsuite/tests/util/LinkedList.test.ts +++ b/testsuite/tests/util/LinkedList.test.ts @@ -1,7 +1,9 @@ import { describe, test, expect } from '@jest/globals'; -import {LinkedList} from '#js/util/LinkedList.js'; +import { LinkedList } from '#js/util/LinkedList.js'; -function inReverse(a: number, b: number) {return a > b} +function inReverse(a: number, b: number) { + return a > b; +} describe('LinkedList functionality', () => { test('Empty list is empty array', () => { @@ -34,14 +36,22 @@ describe('LinkedList functionality', () => { }); test('Removing items', () => { - expect(Array.from(new LinkedList(1, 2, 3, 4).remove())).toEqual([1, 2, 3, 4]); // remove nothing + expect(Array.from(new LinkedList(1, 2, 3, 4).remove())).toEqual([ + 1, 2, 3, 4, + ]); // remove nothing expect(Array.from(new LinkedList(1, 2, 3, 4).remove(1))).toEqual([2, 3, 4]); // at start expect(Array.from(new LinkedList(1, 2, 3, 4).remove(4))).toEqual([1, 2, 3]); // at end expect(Array.from(new LinkedList(1, 2, 3, 4).remove(2))).toEqual([1, 3, 4]); // in midle expect(Array.from(new LinkedList(1, 2, 3, 4).remove(1, 3, 4))).toEqual([2]); // multiple items removed - expect(Array.from(new LinkedList(1, 2, 3, 4).remove(6))).toEqual([1, 2, 3, 4]); // item not in list - expect(Array.from(new LinkedList(1, 2, 3, 4).remove(2, 6))).toEqual([1, 3, 4]); // some items not in list - expect(Array.from(new LinkedList(1, 2, 3, 4).remove(1, 2, 3, 4))).toEqual([]); // all items removed + expect(Array.from(new LinkedList(1, 2, 3, 4).remove(6))).toEqual([ + 1, 2, 3, 4, + ]); // item not in list + expect(Array.from(new LinkedList(1, 2, 3, 4).remove(2, 6))).toEqual([ + 1, 3, 4, + ]); // some items not in list + expect(Array.from(new LinkedList(1, 2, 3, 4).remove(1, 2, 3, 4))).toEqual( + [] + ); // all items removed }); test('Adding nothing', () => { @@ -74,7 +84,8 @@ describe('LinkedList functionality', () => { const list = new LinkedList(0, 1, 2, 3, 4, 5, 6); let j = 0; for (const item of list) { - if (item === j) j++; else break; + if (item !== j) break; + j++; } expect(j).toBe(7); }); @@ -83,7 +94,8 @@ describe('LinkedList functionality', () => { const list = new LinkedList(0, 1, 2, 3, 4, 5, 6); let j = 6; for (const item of list.reversed()) { - if (item === j) j--; else break; + if (item !== j) break; + j--; } expect(j).toBe(-1); }); @@ -106,44 +118,76 @@ describe('LinkedList functionality', () => { const list = new LinkedList(); expect(list.sort()).toBe(list); // sort() returns list expect(Array.from(list.sort())).toEqual([]); // empty list - expect(Array.from(new LinkedList(5, 1, 3, 6, 4, 0, 2).sort())).toEqual([0, 1, 2, 3, 4, 5, 6]); - expect(Array.from(new LinkedList(5, 1, 3, 6, 4, 0, 2).sort(inReverse))).toEqual([6, 5, 4, 3, 2, 1, 0]); + expect(Array.from(new LinkedList(5, 1, 3, 6, 4, 0, 2).sort())).toEqual([ + 0, 1, 2, 3, 4, 5, 6, + ]); + expect( + Array.from(new LinkedList(5, 1, 3, 6, 4, 0, 2).sort(inReverse)) + ).toEqual([6, 5, 4, 3, 2, 1, 0]); }); test('Inserting item in sorted list', () => { const list = new LinkedList(); expect(list.insert(3)).toBe(list); // insert() returns list expect(Array.from(new LinkedList().insert(3))).toEqual([3]); // with empty list - expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(0))).toEqual([0, 1, 3, 4, 5]); // at start - expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(6))).toEqual([1, 3, 4, 5, 6]); // at end - expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(2))).toEqual([1, 2, 3, 4, 5]); // in middle + expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(0))).toEqual([ + 0, 1, 3, 4, 5, + ]); // at start + expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(6))).toEqual([ + 1, 3, 4, 5, 6, + ]); // at end + expect(Array.from(new LinkedList(5, 3, 4, 1).sort().insert(2))).toEqual([ + 1, 2, 3, 4, 5, + ]); // in middle }); test('Inserting with sort function', () => { - expect(Array.from(new LinkedList().insert(3, inReverse))).toEqual([3]); // with empty list - expect(Array.from(new LinkedList(3, 2, 1).insert(4, inReverse))).toEqual([4, 3, 2, 1]); // at start - expect(Array.from(new LinkedList(3, 2, 1).insert(0, inReverse))).toEqual([3, 2, 1, 0]); // at end - expect(Array.from(new LinkedList(4, 3, 1).insert(2, inReverse))).toEqual([4, 3, 2, 1]); // in middle + expect(Array.from(new LinkedList().insert(3, inReverse))).toEqual([3]); // with empty list + expect(Array.from(new LinkedList(3, 2, 1).insert(4, inReverse))).toEqual([ + 4, 3, 2, 1, + ]); // at start + expect(Array.from(new LinkedList(3, 2, 1).insert(0, inReverse))).toEqual([ + 3, 2, 1, 0, + ]); // at end + expect(Array.from(new LinkedList(4, 3, 1).insert(2, inReverse))).toEqual([ + 4, 3, 2, 1, + ]); // in middle }); test('Merging of lists', () => { const list = new LinkedList(1, 3); - expect(list.merge(new LinkedList(2, 4))).toBe(list); // merge() return list + expect(list.merge(new LinkedList(2, 4))).toBe(list); // merge() return list expect(Array.from(new LinkedList().merge(new LinkedList()))).toEqual([]); // with two empty lists - expect(Array.from(new LinkedList().merge(new LinkedList(1, 3, 5)))).toEqual([1, 3, 5]); // with 1st list empty - expect(Array.from(new LinkedList(1, 3, 5).merge(new LinkedList()))).toEqual([1, 3, 5]); // with 2nd list empty - expect(Array.from(new LinkedList(1, 3, 4, 7, 8, 9).merge(new LinkedList(2, 5, 6, 10, 11)))) - .toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); // intermized lists - expect(Array.from(new LinkedList(1, 3, 4).merge(new LinkedList(1, 2, 4, 5)))) - .toEqual([1, 1, 2, 3, 4, 4, 5]); // merge with repeats - expect(Array.from(new LinkedList(1, 2, 3, 4).merge(new LinkedList(5, 6, 7, 8)))) - .toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // at end - expect(Array.from(new LinkedList(5, 6, 7, 8).merge(new LinkedList(1, 2, 3, 4)))) - .toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // at start - expect(Array.from(new LinkedList(1, 2, 7, 8).merge(new LinkedList(3, 4, 5, 6)))) - .toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // in the middle - expect(Array.from(new LinkedList(9, 8, 7, 4, 3, 1).merge(new LinkedList(11, 10, 6, 5, 2, 0), inReverse))) - .toEqual([11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); // with sort function + expect(Array.from(new LinkedList().merge(new LinkedList(1, 3, 5)))).toEqual( + [1, 3, 5] + ); // with 1st list empty + expect(Array.from(new LinkedList(1, 3, 5).merge(new LinkedList()))).toEqual( + [1, 3, 5] + ); // with 2nd list empty + expect( + Array.from( + new LinkedList(1, 3, 4, 7, 8, 9).merge(new LinkedList(2, 5, 6, 10, 11)) + ) + ).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); // intermized lists + expect( + Array.from(new LinkedList(1, 3, 4).merge(new LinkedList(1, 2, 4, 5))) + ).toEqual([1, 1, 2, 3, 4, 4, 5]); // merge with repeats + expect( + Array.from(new LinkedList(1, 2, 3, 4).merge(new LinkedList(5, 6, 7, 8))) + ).toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // at end + expect( + Array.from(new LinkedList(5, 6, 7, 8).merge(new LinkedList(1, 2, 3, 4))) + ).toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // at start + expect( + Array.from(new LinkedList(1, 2, 7, 8).merge(new LinkedList(3, 4, 5, 6))) + ).toEqual([1, 2, 3, 4, 5, 6, 7, 8]); // in the middle + expect( + Array.from( + new LinkedList(9, 8, 7, 4, 3, 1).merge( + new LinkedList(11, 10, 6, 5, 2, 0), + inReverse + ) + ) + ).toEqual([11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]); // with sort function }); - }); diff --git a/testsuite/tests/util/Options.test.ts b/testsuite/tests/util/Options.test.ts index 57016ecd5..c5aa72cad 100644 --- a/testsuite/tests/util/Options.test.ts +++ b/testsuite/tests/util/Options.test.ts @@ -2,13 +2,15 @@ import { describe, test, expect } from '@jest/globals'; import * as Options from '#js/util/Options.js'; const SYMB = Symbol('symbol'); -const OPTIONS = Options.OPTIONS +const OPTIONS = Options.OPTIONS; const optionError = OPTIONS.optionError; describe('Options utility', () => { - test('keys()', () => { - expect(Options.keys({a: 1, [Symbol.iterator]: 2})).toEqual(['a', Symbol.iterator]); + expect(Options.keys({ a: 1, [Symbol.iterator]: 2 })).toEqual([ + 'a', + Symbol.iterator, + ]); expect(Options.keys(null)).toEqual([]); expect(Options.keys({})).toEqual([]); }); @@ -19,11 +21,11 @@ describe('Options utility', () => { // const orig: any = { a: 1, - b: {x: 'x'}, - c: {y: 'y'}, - d: [1, {z: 'z'}, {w: 'w'}], + b: { x: 'x' }, + c: { y: 'y' }, + d: [1, { z: 'z' }, { w: 'w' }], e: [1], - [SYMB]: 1 + [SYMB]: 1, }; let copy = Options.copy(orig); expect(copy).toEqual(orig); @@ -33,20 +35,20 @@ describe('Options utility', () => { // orig.a = 2; orig.b.x = 'xx'; - orig.c = {yy: 'yy'}; + orig.c = { yy: 'yy' }; orig.d[0] = 2; orig.d[1].z = 'zz'; - orig.d[2] = {ww: 'ww'}; + orig.d[2] = { ww: 'ww' }; orig.e = [2]; orig.f = 2; orig[SYMB] = 2; expect(copy).toEqual({ a: 1, - b: {x: 'x'}, - c: {y: 'y'}, - d: [1, {z: 'z'}, {w: 'w'}], + b: { x: 'x' }, + c: { y: 'y' }, + d: [1, { z: 'z' }, { w: 'w' }], e: [1], - [SYMB]: 1 + [SYMB]: 1, }); // @@ -59,8 +61,12 @@ describe('Options utility', () => { // copy = Options.copy({ _a: 1, - get a() {return this._a}, - set a(x) {this._a = x} + get a() { + return this._a; + }, + set a(x) { + this._a = x; + }, }); expect(copy.a).toBe(1); copy.a = 2; @@ -74,9 +80,11 @@ describe('Options utility', () => { test('insert()', () => { let warnings = [] as string[]; - OPTIONS.optionError = (_msg: string, key: string) => {warnings.push(key)}; + OPTIONS.optionError = (_msg: string, key: string) => { + warnings.push(key); + }; - const options = {a: 1, b: {x: 'x', y: [0]}, c: [1, 2, 3]}; + const options = { a: 1, b: { x: 'x', y: [0] }, c: [1, 2, 3] }; let copy = Options.insert({}, options, false); expect(copy).toEqual(options); expect(warnings).toEqual([]); @@ -86,13 +94,13 @@ describe('Options utility', () => { // copy = Options.insert({}, options); expect(copy).toEqual({}); - expect(warnings).toEqual(['a', 'b', 'c']); // invalid keys + expect(warnings).toEqual(['a', 'b', 'c']); // invalid keys warnings = []; - copy = Options.insert({a: 2, b: {}, c: [4]}, options, true); - expect(copy).toEqual({a: 1, b: {}, c: [1, 2, 3]}); - expect(warnings).toEqual(['x', 'y']); // invalid keys + copy = Options.insert({ a: 2, b: {}, c: [4] }, options, true); + expect(copy).toEqual({ a: 1, b: {}, c: [1, 2, 3] }); + expect(warnings).toEqual(['x', 'y']); // invalid keys warnings = []; - copy = Options.insert({}, {[SYMB]: 1}); + copy = Options.insert({}, { [SYMB]: 1 }); expect(copy).toEqual({}); expect(warnings).toEqual(['Symbol(symbol)']); warnings = []; @@ -100,71 +108,85 @@ describe('Options utility', () => { // // insert() adds to objects and replaces other values // - copy = Options.insert({a: 2, b: {}, c: [4]}, options, false); + copy = Options.insert({ a: 2, b: {}, c: [4] }, options, false); expect(copy).toEqual(options); // // insert() merges objects // - copy = Options.insert({a: {}, b: 2}, {a: {x: 'x'}}, false); - expect(copy).toEqual({a: {x: 'x'}, b: 2}); + copy = Options.insert({ a: {}, b: 2 }, { a: { x: 'x' } }, false); + expect(copy).toEqual({ a: { x: 'x' }, b: 2 }); // // insert() merges into functions // - copy = Options.insert({a: function () {}}, {a: {x: 'x'}}, false); + copy = Options.insert({ a: function () {} }, { a: { x: 'x' } }, false); expect(copy.a.x).toBe('x'); // // insert() changes object type // - copy = Options.insert({a: {x: 'x'}}, {a: 1}, false); - expect(copy).toEqual({a: 1}); + copy = Options.insert({ a: { x: 'x' } }, { a: 1 }, false); + expect(copy).toEqual({ a: 1 }); // // insert() replaces arrays // - copy = Options.insert({a: [1, 2]}, {a: [3, 4]}, false); - expect(copy).toEqual({a: [3, 4]}); + copy = Options.insert({ a: [1, 2] }, { a: [3, 4] }, false); + expect(copy).toEqual({ a: [3, 4] }); // // insert() appends to arrays with APPEND key // - copy = Options.insert({a: [1, 2]}, {a: {[Options.APPEND]:[3, 4]}}, false); - expect(copy).toEqual({a: [1, 2, 3, 4]}); + copy = Options.insert( + { a: [1, 2] }, + { a: { [Options.APPEND]: [3, 4] } }, + false + ); + expect(copy).toEqual({ a: [1, 2, 3, 4] }); // // insert() removes from arrays with REMOVE key // - copy = Options.insert({a: [1, 2, 3, 4]}, {a: {[Options.REMOVE]:[1, 3]}}, false); - expect(copy).toEqual({a: [2, 4]}); + copy = Options.insert( + { a: [1, 2, 3, 4] }, + { a: { [Options.REMOVE]: [1, 3] } }, + false + ); + expect(copy).toEqual({ a: [2, 4] }); // // insert() adds and removes from arrays // - copy = Options.insert({a: [1, 2, 3, 4]}, {a: {[Options.REMOVE]:[1, 3], [Options.APPEND]: [3, 5]}}, false); - expect(copy).toEqual({a: [2, 4, 3, 5]}); + copy = Options.insert( + { a: [1, 2, 3, 4] }, + { a: { [Options.REMOVE]: [1, 3], [Options.APPEND]: [3, 5] } }, + false + ); + expect(copy).toEqual({ a: [2, 4, 3, 5] }); // // insert() handles empty objects // - copy = Options.insert({a: 1}, {}); - expect(copy).toEqual({a: 1}); + copy = Options.insert({ a: 1 }, {}); + expect(copy).toEqual({ a: 1 }); expect(warnings).toEqual([]); OPTIONS.optionError = optionError; }); test('expandable()', () => { - let warnings = [] as string[]; - OPTIONS.optionError = (_msg: string, key: string) => {warnings.push(key)}; + const warnings = [] as string[]; + OPTIONS.optionError = (_msg: string, key: string) => { + warnings.push(key); + }; // // No error for unknonw keys in expandables // - const options = {a: Options.expandable({x: 1})}; - let copy = Options.userOptions(options, {a: {y: 2}}); - expect(copy).toEqual({a: {x: 1, y: 2}}); + const options = { a: Options.expandable({ x: 1 }) }; + let copy = Options.userOptions(options, { a: { y: 2 } }); + expect(copy).toEqual({ a: { x: 1, y: 2 } }); expect(warnings).toEqual([]); OPTIONS.optionError = optionError; @@ -172,17 +194,19 @@ describe('Options utility', () => { // // Expandable copies as expandable // - copy = Options.copy(Options.expandable({x: 1})); + copy = Options.copy(Options.expandable({ x: 1 })); expect(copy instanceof Options.Expandable).toBe(true); - expect(copy).toEqual({x:1}); + expect(copy).toEqual({ x: 1 }); }); test('defaultOptions()', () => { let warnings = 0; - OPTIONS.optionError = () => {warnings++}; + OPTIONS.optionError = () => { + warnings++; + }; - const copy = Options.defaultOptions({}, {a: 1}, {b: 2}); - expect(copy).toEqual({a: 1, b: 2}); + const copy = Options.defaultOptions({}, { a: 1 }, { b: 2 }); + expect(copy).toEqual({ a: 1, b: 2 }); expect(warnings).toBe(0); OPTIONS.optionError = optionError; @@ -190,12 +214,14 @@ describe('Options utility', () => { test('userOptions()', () => { let warnings = [] as string[]; - OPTIONS.optionError = (_msg: string, key: string) => {warnings.push(key)}; + OPTIONS.optionError = (_msg: string, key: string) => { + warnings.push(key); + }; // // userOptions() warns about invalid options // - let copy = Options.userOptions({}, {a: 1}, {b: 2}); + let copy = Options.userOptions({}, { a: 1 }, { b: 2 }); expect(copy).toEqual({}); expect(warnings).toEqual(['a', 'b']); warnings = []; @@ -203,16 +229,16 @@ describe('Options utility', () => { // // userOptions() warns about invalid secondary options // - copy = Options.userOptions({a: 'x'}, {a: 1}, {b: 2}); - expect(copy).toEqual({a: 1}); + copy = Options.userOptions({ a: 'x' }, { a: 1 }, { b: 2 }); + expect(copy).toEqual({ a: 1 }); expect(warnings).toEqual(['b']); warnings = []; // // userOptions() merges multiple options // - copy = Options.userOptions({a: 'x', b: 'y'}, {a: 1}, {b: 2}); - expect(copy).toEqual({a: 1, b: 2}); + copy = Options.userOptions({ a: 'x', b: 'y' }, { a: 1 }, { b: 2 }); + expect(copy).toEqual({ a: 1, b: 2 }); expect(warnings).toEqual([]); OPTIONS.optionError = optionError; @@ -222,9 +248,9 @@ describe('Options utility', () => { // // selectOptions() finds existing keys and skips others // - const options = {a: 1, b: 2, c: 3, d: 4}; + const options = { a: 1, b: 2, c: 3, d: 4 }; let copy = Options.selectOptions(options, 'a', 'c', 'x', 'y'); - expect(copy).toEqual({a: 1, c: 3}); + expect(copy).toEqual({ a: 1, c: 3 }); // // selectOptions() handles empty list @@ -243,9 +269,14 @@ describe('Options utility', () => { // // selectOptionsFromKeys() finds existing keys and skips others // - const options = {a: 1, b: 2, c: 3, d: 4}; - let copy = Options.selectOptionsFromKeys(options, {a: true, c: true, x: true, y: true}); - expect(copy).toEqual({a: 1, c: 3}); + const options = { a: 1, b: 2, c: 3, d: 4 }; + let copy = Options.selectOptionsFromKeys(options, { + a: true, + c: true, + x: true, + y: true, + }); + expect(copy).toEqual({ a: 1, c: 3 }); // // selectOptionsFromKeys() handles empty source list // @@ -262,15 +293,22 @@ describe('Options utility', () => { // // separateOptions() works with one set // - const options = {a: 1, b: 2, c: 3, d: 4, e: 5}; - let result = Options.separateOptions(options, {a: true, c: true}); - expect(result).toEqual([{b: 2, d: 4, e: 5}, {a: 1, c: 3}]); + const options = { a: 1, b: 2, c: 3, d: 4, e: 5 }; + let result = Options.separateOptions(options, { a: true, c: true }); + expect(result).toEqual([ + { b: 2, d: 4, e: 5 }, + { a: 1, c: 3 }, + ]); // // separateOptions() works with two sets // - result = Options.separateOptions(options, {a: true, c: true}, {d: true}); - expect(result).toEqual([{b: 2, e: 5}, {a: 1, c: 3}, {d: 4}]); + result = Options.separateOptions( + options, + { a: true, c: true }, + { d: true } + ); + expect(result).toEqual([{ b: 2, e: 5 }, { a: 1, c: 3 }, { d: 4 }]); // // separateOptions() works with no sets @@ -281,19 +319,22 @@ describe('Options utility', () => { // // separateOptions() works with unknown keys // - result = Options.separateOptions(options, {a: true, c: true, x: true}); - expect(result).toEqual([{b: 2, d: 4, e: 5}, {a: 1, c: 3}]); + result = Options.separateOptions(options, { a: true, c: true, x: true }); + expect(result).toEqual([ + { b: 2, d: 4, e: 5 }, + { a: 1, c: 3 }, + ]); // // separateOptions() works with empty options // - result = Options.separateOptions({}, {a: true}); + result = Options.separateOptions({}, { a: true }); expect(result).toEqual([{}, {}]); // // separateOptions() works with no options // - result = Options.separateOptions(null, {a: true}); + result = Options.separateOptions(null, { a: true }); expect(result).toEqual([{}, {}]); }); @@ -305,8 +346,8 @@ describe('Options utility', () => { // OPTIONS.invalidOption = 'fatal'; try { - copy = Options.userOptions({}, {a: 1}); - } catch(err) { + copy = Options.userOptions({}, { a: 1 }); + } catch (err) { expect(err.message).toBe('Invalid option "a" (no default value).'); } expect(copy).toEqual(undefined); @@ -315,14 +356,15 @@ describe('Options utility', () => { // Warn does not throw an error // const warn = console.warn; - console.warn = () => {} + console.warn = () => {}; OPTIONS.invalidOption = 'warn'; try { - copy = Options.userOptions({}, {a: 1}); - } catch(err) {} + copy = Options.userOptions({}, { a: 1 }); + } catch { + // Should not throw an error + } expect(copy).toEqual({}); console.warn = warn; - }); test('makeArray()', () => { @@ -331,10 +373,9 @@ describe('Options utility', () => { }); test('lookup()', () => { - const options = {a: 1, b: 'x'}; + const options = { a: 1, b: 'x' }; expect(Options.lookup('a', options)).toBe(1); expect(Options.lookup('c', options, 'default')).toBe('default'); expect(Options.lookup('c', options)).toBe(null); }); - }); diff --git a/testsuite/tests/util/PrioritizedList.test.ts b/testsuite/tests/util/PrioritizedList.test.ts index f3a6f7bc1..1db075003 100644 --- a/testsuite/tests/util/PrioritizedList.test.ts +++ b/testsuite/tests/util/PrioritizedList.test.ts @@ -1,12 +1,12 @@ import { describe, test, expect } from '@jest/globals'; -import {PrioritizedList} from '#js/util/PrioritizedList.js'; +import { PrioritizedList } from '#js/util/PrioritizedList.js'; // // Turn the item list into a list of just that data // function ARRAY(list: PrioritizedList) { - let array = []; - for (const {item} of list) array.push(item); + const array = []; + for (const { item } of list) array.push(item); return array; } @@ -19,7 +19,7 @@ describe('PrioritizedList functionality', () => { const list = new PrioritizedList(); const item = list.add(0); expect(Array.from(list)).toHaveLength(1); - expect(Array.from(list)).toEqual([{item: 0, priority: 5}]); + expect(Array.from(list)).toEqual([{ item: 0, priority: 5 }]); expect(item).toBe(0); }); @@ -33,23 +33,30 @@ describe('PrioritizedList functionality', () => { test('Sorting of list', () => { const list = new PrioritizedList(); - for (const i of [5, 0, 2, 1, 6, 3, 4]) {list.add(i, i)} + for (const i of [5, 0, 2, 1, 6, 3, 4]) { + list.add(i, i); + } expect(ARRAY(list)).toEqual([0, 1, 2, 3, 4, 5, 6]); }); test('Iterator', () => { const list = new PrioritizedList(); - for (const i of [5, 0, 2, 1, 6, 3, 4]) {list.add(i, i)} + for (const i of [5, 0, 2, 1, 6, 3, 4]) { + list.add(i, i); + } let j = 0; for (const item of list) { - if (item.item === j) j++; else break; + if (item.item === j) j++; + else break; } expect(j).toBe(7); }); test('Removing from longer list', () => { const list = new PrioritizedList(); - for (const i of [5, 0, 2, 1, 6, 3, 4]) {list.add(i, i)} + for (const i of [5, 0, 2, 1, 6, 3, 4]) { + list.add(i, i); + } list.remove(3); // remove from middle expect(ARRAY(list)).toEqual([0, 1, 2, 4, 5, 6]); list.remove(0); // remove first @@ -61,10 +68,9 @@ describe('PrioritizedList functionality', () => { test('Adding with same priority', () => { const list = new PrioritizedList(); list.add(3); - list.add(1,1); + list.add(1, 1); list.add(4); - list.add(2,1); + list.add(2, 1); expect(ARRAY(list)).toEqual([1, 2, 3, 4]); }); - }); diff --git a/testsuite/tests/util/Retries.test.ts b/testsuite/tests/util/Retries.test.ts index 45d3e4fb0..578ed649e 100644 --- a/testsuite/tests/util/Retries.test.ts +++ b/testsuite/tests/util/Retries.test.ts @@ -1,35 +1,41 @@ import { describe, test, expect } from '@jest/globals'; -import {handleRetriesFor, retryAfter} from '#js/util/Retries.js'; -import {MathJax as MJX, MathJaxObject} from '#js/components/global.js'; +import { handleRetriesFor, retryAfter } from '#js/util/Retries.js'; +import { MathJax as MJX, MathJaxObject } from '#js/components/global.js'; /** * Add the legacy MathJax.CallBack for teting v2-style restarts */ type MathJaxGlobal = MathJaxObject & { + /* eslint-disable @typescript-eslint/no-unsafe-function-type */ Callback: { - After(code: Function): void, - mock(): Function - } + After(code: Function): void; + mock(): Function; + }; }; const MathJax: MathJaxGlobal = Object.assign(MJX, { Callback: { After(code: () => void) { setTimeout(code, 1); }, - mock() {return Object.assign(() => {}, {isCallback: true})} - } + mock() { + return Object.assign(() => {}, { isCallback: true }); + }, + }, }); /**********************************************************************************/ /**********************************************************************************/ describe('handleRetriesFor() and retryAfter()', () => { - /********************************************************************************/ test('handleRetriesFor() then/catch getting called', () => { expect(handleRetriesFor(() => 'success')).resolves.toBe('success'); - expect(handleRetriesFor(() => {throw Error('failed')})).rejects.toThrow('failed'); + expect( + handleRetriesFor(() => { + throw Error('failed'); + }) + ).rejects.toThrow('failed'); }); /********************************************************************************/ @@ -38,7 +44,7 @@ describe('handleRetriesFor() and retryAfter()', () => { let n = 0; handleRetriesFor(() => { if (++n < 3) { - let p = new Promise((ok, _fail) => { + const p = new Promise((ok, _fail) => { setTimeout(() => ok(), 1); }); retryAfter(p); @@ -56,8 +62,8 @@ describe('handleRetriesFor() and retryAfter()', () => { let n = 0; handleRetriesFor(() => { if (++n < 3) { - let p = new Promise((ok, fail) => { - setTimeout(() => n < 2 ? ok() : fail('fail'), 1); + const p = new Promise((ok, fail) => { + setTimeout(() => (n < 2 ? ok() : fail('fail')), 1); }); retryAfter(p); } @@ -74,7 +80,7 @@ describe('handleRetriesFor() and retryAfter()', () => { let n = 0; handleRetriesFor(() => { if (++n < 3) { - let p = new Promise((ok, _fail) => { + const p = new Promise((ok, _fail) => { setTimeout(() => ok(), 1); }); retryAfter(p); @@ -93,7 +99,7 @@ describe('handleRetriesFor() and retryAfter()', () => { handleRetriesFor(() => { if (++n < 3) { throw Object.assign(new Error('restart'), { - restart: MathJax.Callback.mock() // mark this error as a v2 restart + restart: MathJax.Callback.mock(), // mark this error as a v2 restart }); } return 'success'; @@ -106,19 +112,27 @@ describe('handleRetriesFor() and retryAfter()', () => { /********************************************************************************/ test('handleRetriedFor() async success', () => { - expect(handleRetriesFor(async () => { - const wait = new Promise((ok, _fail) => setTimeout(() => ok('success'), 1)); - return (await wait); - })).resolves.toBe('success'); + expect( + handleRetriesFor(async () => { + const wait = new Promise((ok, _fail) => + setTimeout(() => ok('success'), 1) + ); + return await wait; + }) + ).resolves.toBe('success'); }); /********************************************************************************/ test('handleRetriedFor() async fails', () => { - expect(handleRetriesFor(async () => { - const wait = new Promise((_ok, fail) => setTimeout(() => fail('fail'), 1)); - return (await wait); - })).rejects.toBe('fail'); + expect( + handleRetriesFor(async () => { + const wait = new Promise((_ok, fail) => + setTimeout(() => fail('fail'), 1) + ); + return await wait; + }) + ).rejects.toBe('fail'); }); /********************************************************************************/ @@ -128,7 +142,7 @@ describe('handleRetriesFor() and retryAfter()', () => { handleRetriesFor(async () => { if (++n < 3) { await new Promise((ok, _fail) => setTimeout(ok, 1)); - let p = new Promise((ok, _fail) => { + const p = new Promise((ok, _fail) => { setTimeout(() => ok(), 1); }); retryAfter(p); @@ -141,7 +155,6 @@ describe('handleRetriesFor() and retryAfter()', () => { }); /********************************************************************************/ - }); /**********************************************************************************/ diff --git a/testsuite/tests/util/StyleJson.test.ts b/testsuite/tests/util/StyleJson.test.ts index 08d76dd2c..bd4c4a204 100644 --- a/testsuite/tests/util/StyleJson.test.ts +++ b/testsuite/tests/util/StyleJson.test.ts @@ -1,35 +1,46 @@ import { describe, test, expect } from '@jest/globals'; -import {StyleJsonSheet} from '#js/util/StyleJson.js'; +import { StyleJsonSheet } from '#js/util/StyleJson.js'; describe('StyleJsonSheet object', () => { - test('CssStyle creation', () => { expect(new StyleJsonSheet().cssText).toBe(''); - expect(new StyleJsonSheet({'.mjx': {padding: '0px'}}).cssText).toBe('.mjx {\n padding: 0px;\n}'); - expect(new StyleJsonSheet({ - '.mjx': { - padding: '0px', - 'font-size': '150%' - }, - p: { - 'font-weight': 'bold' - } - }).cssText).toBe([ - '.mjx {', - ' padding: 0px;', - ' font-size: 150%;', - '}', - '', - 'p {', - ' font-weight: bold;', - '}' - ].join('\n')); + expect(new StyleJsonSheet({ '.mjx': { padding: '0px' } }).cssText).toBe( + '.mjx {\n padding: 0px;\n}' + ); + expect( + new StyleJsonSheet({ + '.mjx': { + padding: '0px', + 'font-size': '150%', + }, + p: { + 'font-weight': 'bold', + }, + }).cssText + ).toBe( + [ + '.mjx {', + ' padding: 0px;', + ' font-size: 150%;', + '}', + '', + 'p {', + ' font-weight: bold;', + '}', + ].join('\n') + ); }); test('Add/remove styles', () => { const styles = new StyleJsonSheet(); - styles.addStyles({p: {'font-weight': 'bold'}, h1: {'font-size': '150%'}, 'h2': {}}); - expect(styles.cssText).toBe('p {\n font-weight: bold;\n}\n\nh1 {\n font-size: 150%;\n}\n\nh2 {\n\n}'); + styles.addStyles({ + p: { 'font-weight': 'bold' }, + h1: { 'font-size': '150%' }, + h2: {}, + }); + expect(styles.cssText).toBe( + 'p {\n font-weight: bold;\n}\n\nh1 {\n font-size: 150%;\n}\n\nh2 {\n\n}' + ); styles.removeStyles('h1', 'h2'); expect(styles.cssText).toBe('p {\n font-weight: bold;\n}'); styles.clear(); @@ -37,19 +48,22 @@ describe('StyleJsonSheet object', () => { }); test('Compound style', () => { - expect(new StyleJsonSheet({ - '@media (prefers-color-scheme: dark)': { - 'mjx-container': { - 'color': '#E0E0E0', + expect( + new StyleJsonSheet({ + '@media (prefers-color-scheme: dark)': { + 'mjx-container': { + color: '#E0E0E0', + }, }, - } - }).cssText).toBe([ - '@media (prefers-color-scheme: dark) {', - ' mjx-container {', - ' color: #E0E0E0;', - ' }', - '}' - ].join('\n')); + }).cssText + ).toBe( + [ + '@media (prefers-color-scheme: dark) {', + ' mjx-container {', + ' color: #E0E0E0;', + ' }', + '}', + ].join('\n') + ); }); - }); diff --git a/testsuite/tests/util/Styles.test.ts b/testsuite/tests/util/Styles.test.ts index 1c5cdc381..85b8094d6 100644 --- a/testsuite/tests/util/Styles.test.ts +++ b/testsuite/tests/util/Styles.test.ts @@ -1,5 +1,5 @@ import { describe, test, expect } from '@jest/globals'; -import {Styles, StyleList} from '#js/util/Styles.js'; +import { Styles, StyleList } from '#js/util/Styles.js'; function cssTest(css: string, list: StyleList, text: string = css + ';') { const styles = new Styles(css); @@ -8,146 +8,207 @@ function cssTest(css: string, list: StyleList, text: string = css + ';') { } function cssFontTest(css: string, list: StyleList) { - const test = Array.from(Object.keys(list)).map((k) => `${k}: ${list[k]};`).join(' '); + const test = Array.from(Object.keys(list)) + .map((k) => `${k}: ${list[k]};`) + .join(' '); return cssTest(css, list, test); } describe('CssStyles object', () => { - test('Styles parsing', () => { cssTest('', {}, ''); // emtpy list - cssTest('font-size: 150%', {'font-size': '150%'}); // one style - cssTest('abc-def: 0', {'abc-def': '0'}); // unknown style is retained - cssTest('a: 0; b: 1px', {a: '0', b: '1px'}); // multiple styles - cssTest('a: 0; /*b: 1px*/ c: bold', {a: '0', c: 'bold'}, 'a: 0; c: bold;'); // comments - cssTest(' a : \n 0 ; b\n : 1px \n ', {a: '0', b: '1px'}, 'a: 0; b: 1px;'); // extra spaces - cssTest('abc: ; xyz: 0', {xyz: '0'}, 'xyz: 0;'); // missing value + cssTest('font-size: 150%', { 'font-size': '150%' }); // one style + cssTest('abc-def: 0', { 'abc-def': '0' }); // unknown style is retained + cssTest('a: 0; b: 1px', { a: '0', b: '1px' }); // multiple styles + cssTest( + 'a: 0; /*b: 1px*/ c: bold', + { a: '0', c: 'bold' }, + 'a: 0; c: bold;' + ); // comments + cssTest( + ' a : \n 0 ; b\n : 1px \n ', + { a: '0', b: '1px' }, + 'a: 0; b: 1px;' + ); // extra spaces + cssTest('abc: ; xyz: 0', { xyz: '0' }, 'xyz: 0;'); // missing value cssTest('abc xyz: 1px', {}, ''); // malformed CSS string - cssTest(`abc: xy 'pqr`, {abc: `xy 'pqr'`}, `abc: xy 'pqr';`); // append missing ' - cssTest(`abc: xy "pqr`, {abc: `xy "pqr"`}, `abc: xy "pqr";`); // append missing " - cssTest(`abc: xy '\\'pqr`, {abc: `xy '\\'pqr'`}, `abc: xy '\\'pqr';`); // handle quoted ' - cssTest(`abc: xy "\\"pqr`, {abc: `xy "\\"pqr"`}, `abc: xy "\\"pqr";`); // handle quoted " - cssTest(`abc: ';'`, {abc: `';'`}); // handle quoted ; - cssTest(`abc: ';`, {abc: `';'`}, `abc: ';';`); // and missing ' + cssTest(`abc: xy 'pqr`, { abc: `xy 'pqr'` }, `abc: xy 'pqr';`); // append missing ' + cssTest(`abc: xy "pqr`, { abc: `xy "pqr"` }, `abc: xy "pqr";`); // append missing " + cssTest(`abc: xy '\\'pqr`, { abc: `xy '\\'pqr'` }, `abc: xy '\\'pqr';`); // handle quoted ' + cssTest(`abc: xy "\\"pqr`, { abc: `xy "\\"pqr"` }, `abc: xy "\\"pqr";`); // handle quoted " + cssTest(`abc: ';'`, { abc: `';'` }); // handle quoted ; + cssTest(`abc: ';`, { abc: `';'` }, `abc: ';';`); // and missing ' - cssTest('\nabc\n:\n xyz \n; \n def \n : \n pqr\n ; \n ', { - abc: 'xyz', - def: 'pqr' - }, 'abc: xyz; def: pqr;'); - cssTest(`abc: \n xy \n 'pqr\n`, {abc: `xy 'pqr '`}, `abc: xy 'pqr ';`); + cssTest( + '\nabc\n:\n xyz \n; \n def \n : \n pqr\n ; \n ', + { + abc: 'xyz', + def: 'pqr', + }, + 'abc: xyz; def: pqr;' + ); + cssTest( + `abc: \n xy \n 'pqr\n`, + { abc: `xy 'pqr '` }, + `abc: xy 'pqr ';` + ); // // Remove unquoted ; and beyond // const styles = new Styles(); styles.set('abc', 'xy ; z'); - expect(styles.styleList).toEqual({abc: 'xy'}); + expect(styles.styleList).toEqual({ abc: 'xy' }); expect(styles.cssText).toBe('abc: xy;'); }); test('padding', () => { cssTest('padding: 3px', { - 'padding': '3px', + padding: '3px', 'padding-bottom': '3px', 'padding-left': '3px', 'padding-right': '3px', - 'padding-top': '3px' + 'padding-top': '3px', }); - cssTest('padding: 3px; padding-right: 1px', { - 'padding': '3px 1px 3px 3px', - 'padding-bottom': '3px', - 'padding-left': '3px', - 'padding-right': '1px', - 'padding-top': '3px' - }, 'padding: 3px 1px 3px 3px;'); - cssTest('padding-top: 0; padding-right: 1px; padding-bottom: 0; padding-left: 1px', { - 'padding': '0 1px', - 'padding-bottom': '0', - 'padding-left': '1px', - 'padding-right': '1px', - 'padding-top': '0' - }, 'padding: 0 1px;'); - cssTest('padding-top: 0; padding-right: 1px; padding-bottom: 2px; padding-left: 1px', { - 'padding': '0 1px 2px', - 'padding-bottom': '2px', - 'padding-left': '1px', - 'padding-right': '1px', - 'padding-top': '0' - }, 'padding: 0 1px 2px;'); - cssTest('padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0', { - 'padding': '0', - 'padding-bottom': '0', - 'padding-left': '0', - 'padding-right': '0', - 'padding-top': '0' - }, 'padding: 0;'); - cssTest('padding-left: 2px; padding: 0', { - 'padding': '0', - 'padding-bottom': '0', - 'padding-left': '0', - 'padding-right': '0', - 'padding-top': '0' - }, 'padding: 0;'); + cssTest( + 'padding: 3px; padding-right: 1px', + { + padding: '3px 1px 3px 3px', + 'padding-bottom': '3px', + 'padding-left': '3px', + 'padding-right': '1px', + 'padding-top': '3px', + }, + 'padding: 3px 1px 3px 3px;' + ); + cssTest( + 'padding-top: 0; padding-right: 1px; padding-bottom: 0; padding-left: 1px', + { + padding: '0 1px', + 'padding-bottom': '0', + 'padding-left': '1px', + 'padding-right': '1px', + 'padding-top': '0', + }, + 'padding: 0 1px;' + ); + cssTest( + 'padding-top: 0; padding-right: 1px; padding-bottom: 2px; padding-left: 1px', + { + padding: '0 1px 2px', + 'padding-bottom': '2px', + 'padding-left': '1px', + 'padding-right': '1px', + 'padding-top': '0', + }, + 'padding: 0 1px 2px;' + ); + cssTest( + 'padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0', + { + padding: '0', + 'padding-bottom': '0', + 'padding-left': '0', + 'padding-right': '0', + 'padding-top': '0', + }, + 'padding: 0;' + ); + cssTest( + 'padding-left: 2px; padding: 0', + { + padding: '0', + 'padding-bottom': '0', + 'padding-left': '0', + 'padding-right': '0', + 'padding-top': '0', + }, + 'padding: 0;' + ); cssTest('padding:', {}, ''); }); test('margin', () => { - cssTest('margin-left: 2px; margin: 0', { - 'margin': '0', - 'margin-bottom': '0', - 'margin-left': '0', - 'margin-right': '0', - 'margin-top': '0' - }, 'margin: 0;'); + cssTest( + 'margin-left: 2px; margin: 0', + { + margin: '0', + 'margin-bottom': '0', + 'margin-left': '0', + 'margin-right': '0', + 'margin-top': '0', + }, + 'margin: 0;' + ); cssTest('margin: 3px', { - 'margin': '3px', + margin: '3px', 'margin-bottom': '3px', 'margin-left': '3px', 'margin-right': '3px', - 'margin-top': '3px' + 'margin-top': '3px', }); - cssTest('margin: 3px; margin-right: 1px', { - 'margin': '3px 1px 3px 3px', - 'margin-bottom': '3px', - 'margin-left': '3px', - 'margin-right': '1px', - 'margin-top': '3px' - }, 'margin: 3px 1px 3px 3px;'); - cssTest('margin-top: 0; margin-right: 1px; margin-bottom: 0; margin-left: 1px', { - 'margin': '0 1px', - 'margin-bottom': '0', - 'margin-left': '1px', - 'margin-right': '1px', - 'margin-top': '0' - }, 'margin: 0 1px;'); - cssTest('margin-top: 0; margin-right: 1px; margin-bottom: 2px; margin-left: 1px', { - 'margin': '0 1px 2px', - 'margin-bottom': '2px', - 'margin-left': '1px', - 'margin-right': '1px', - 'margin-top': '0' - }, 'margin: 0 1px 2px;'); - cssTest('margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0', { - 'margin': '0', - 'margin-bottom': '0', - 'margin-left': '0', - 'margin-right': '0', - 'margin-top': '0' - }, 'margin: 0;'); - cssTest('margin-left: 2px; margin: 0', { - 'margin': '0', - 'margin-bottom': '0', - 'margin-left': '0', - 'margin-right': '0', - 'margin-top': '0' - }, 'margin: 0;'); + cssTest( + 'margin: 3px; margin-right: 1px', + { + margin: '3px 1px 3px 3px', + 'margin-bottom': '3px', + 'margin-left': '3px', + 'margin-right': '1px', + 'margin-top': '3px', + }, + 'margin: 3px 1px 3px 3px;' + ); + cssTest( + 'margin-top: 0; margin-right: 1px; margin-bottom: 0; margin-left: 1px', + { + margin: '0 1px', + 'margin-bottom': '0', + 'margin-left': '1px', + 'margin-right': '1px', + 'margin-top': '0', + }, + 'margin: 0 1px;' + ); + cssTest( + 'margin-top: 0; margin-right: 1px; margin-bottom: 2px; margin-left: 1px', + { + margin: '0 1px 2px', + 'margin-bottom': '2px', + 'margin-left': '1px', + 'margin-right': '1px', + 'margin-top': '0', + }, + 'margin: 0 1px 2px;' + ); + cssTest( + 'margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0', + { + margin: '0', + 'margin-bottom': '0', + 'margin-left': '0', + 'margin-right': '0', + 'margin-top': '0', + }, + 'margin: 0;' + ); + cssTest( + 'margin-left: 2px; margin: 0', + { + margin: '0', + 'margin-bottom': '0', + 'margin-left': '0', + 'margin-right': '0', + 'margin-top': '0', + }, + 'margin: 0;' + ); cssTest('margin:', {}, ''); - }), + }) test('border', () => { cssTest('border: 3px solid red', { - 'border': '3px solid red', + border: '3px solid red', 'border-top': '3px solid red', 'border-top-color': 'red', 'border-top-style': 'solid', @@ -163,70 +224,90 @@ describe('CssStyles object', () => { 'border-left': '3px solid red', 'border-left-color': 'red', 'border-left-style': 'solid', - 'border-left-width': '3px' + 'border-left-width': '3px', }); - cssTest('border: 3px solid red; border-top: inset blue 2px', { - 'border-top': 'inset blue 2px', - 'border-top-color': 'blue', - 'border-top-style': 'inset', - 'border-top-width': '2px', - 'border-right': '3px solid red', - 'border-right-color': 'red', - 'border-right-style': 'solid', - 'border-right-width': '3px', - 'border-bottom': '3px solid red', - 'border-bottom-color': 'red', - 'border-bottom-style': 'solid', - 'border-bottom-width': '3px', - 'border-left': '3px solid red', - 'border-left-color': 'red', - 'border-left-style': 'solid', - 'border-left-width': '3px' - }, [ - 'border-top: inset blue 2px; border-right: 3px solid red;', - 'border-bottom: 3px solid red; border-left: 3px solid red;' - ].join(' ')); - cssTest('border: 3px solid red; border-top-color: blue', { - 'border-top': '3px solid blue', - 'border-top-color': 'blue', - 'border-top-style': 'solid', - 'border-top-width': '3px', - 'border-right': '3px solid red', - 'border-right-color': 'red', - 'border-right-style': 'solid', - 'border-right-width': '3px', - 'border-bottom': '3px solid red', - 'border-bottom-color': 'red', - 'border-bottom-style': 'solid', - 'border-bottom-width': '3px', - 'border-left': '3px solid red', - 'border-left-color': 'red', - 'border-left-style': 'solid', - 'border-left-width': '3px' - }, [ - 'border-top: 3px solid blue; border-right: 3px solid red;', - 'border-bottom: 3px solid red; border-left: 3px solid red;' - ].join(' ')); - cssTest('border-top: 3px solid red; border-top-color: blue', { - 'border-top': '3px solid blue', - 'border-top-color': 'blue', - 'border-top-style': 'solid', - 'border-top-width': '3px', - }, 'border-top: 3px solid blue;'); - cssTest('border-top: 3px solid red; border-top-style: groove', { - 'border-top': '3px groove red', - 'border-top-color': 'red', - 'border-top-style': 'groove', - 'border-top-width': '3px', - }, 'border-top: 3px groove red;'); - cssTest('border-top: 3px solid red; border-top-width: 2px', { - 'border-top': '2px solid red', - 'border-top-color': 'red', - 'border-top-style': 'solid', - 'border-top-width': '2px', - }, 'border-top: 2px solid red;'); + cssTest( + 'border: 3px solid red; border-top: inset blue 2px', + { + 'border-top': 'inset blue 2px', + 'border-top-color': 'blue', + 'border-top-style': 'inset', + 'border-top-width': '2px', + 'border-right': '3px solid red', + 'border-right-color': 'red', + 'border-right-style': 'solid', + 'border-right-width': '3px', + 'border-bottom': '3px solid red', + 'border-bottom-color': 'red', + 'border-bottom-style': 'solid', + 'border-bottom-width': '3px', + 'border-left': '3px solid red', + 'border-left-color': 'red', + 'border-left-style': 'solid', + 'border-left-width': '3px', + }, + [ + 'border-top: inset blue 2px; border-right: 3px solid red;', + 'border-bottom: 3px solid red; border-left: 3px solid red;', + ].join(' ') + ); + cssTest( + 'border: 3px solid red; border-top-color: blue', + { + 'border-top': '3px solid blue', + 'border-top-color': 'blue', + 'border-top-style': 'solid', + 'border-top-width': '3px', + 'border-right': '3px solid red', + 'border-right-color': 'red', + 'border-right-style': 'solid', + 'border-right-width': '3px', + 'border-bottom': '3px solid red', + 'border-bottom-color': 'red', + 'border-bottom-style': 'solid', + 'border-bottom-width': '3px', + 'border-left': '3px solid red', + 'border-left-color': 'red', + 'border-left-style': 'solid', + 'border-left-width': '3px', + }, + [ + 'border-top: 3px solid blue; border-right: 3px solid red;', + 'border-bottom: 3px solid red; border-left: 3px solid red;', + ].join(' ') + ); + cssTest( + 'border-top: 3px solid red; border-top-color: blue', + { + 'border-top': '3px solid blue', + 'border-top-color': 'blue', + 'border-top-style': 'solid', + 'border-top-width': '3px', + }, + 'border-top: 3px solid blue;' + ); + cssTest( + 'border-top: 3px solid red; border-top-style: groove', + { + 'border-top': '3px groove red', + 'border-top-color': 'red', + 'border-top-style': 'groove', + 'border-top-width': '3px', + }, + 'border-top: 3px groove red;' + ); + cssTest( + 'border-top: 3px solid red; border-top-width: 2px', + { + 'border-top': '2px solid red', + 'border-top-color': 'red', + 'border-top-style': 'solid', + 'border-top-width': '2px', + }, + 'border-top: 2px solid red;' + ); cssTest('border: 3px solid', { - 'border': '3px solid', + border: '3px solid', 'border-bottom': '3px solid', 'border-bottom-style': 'solid', 'border-bottom-width': '3px', @@ -241,7 +322,7 @@ describe('CssStyles object', () => { 'border-top-width': '3px', }); cssTest('border: 3px blue', { - 'border': '3px blue', + border: '3px blue', 'border-bottom': '3px blue', 'border-bottom-color': 'blue', 'border-bottom-width': '3px', @@ -256,7 +337,7 @@ describe('CssStyles object', () => { 'border-top-width': '3px', }); cssTest('border: solid blue', { - 'border': 'solid blue', + border: 'solid blue', 'border-bottom': 'solid blue', 'border-bottom-color': 'blue', 'border-bottom-style': 'solid', @@ -270,44 +351,56 @@ describe('CssStyles object', () => { 'border-top-color': 'blue', 'border-top-style': 'solid', }); - cssTest('border-top: red; border-right: red; border-bottom: red; border-left: red', { - 'border': 'red', - 'border-bottom': 'red', - 'border-bottom-color': 'red', - 'border-left': 'red', - 'border-left-color': 'red', - 'border-right': 'red', - 'border-right-color': 'red', - 'border-top': 'red', - 'border-top-color': 'red', - }, 'border: red;'); - cssTest('border: 3px solid red; border-width: 2px', { - 'border': '2px solid red', - 'border-bottom': '2px solid red', - 'border-bottom-color': 'red', - 'border-bottom-style': 'solid', - 'border-bottom-width': '2px', - 'border-left': '2px solid red', - 'border-left-color': 'red', - 'border-left-style': 'solid', - 'border-left-width': '2px', - 'border-right': '2px solid red', - 'border-right-color': 'red', - 'border-right-style': 'solid', - 'border-right-width': '2px', - 'border-top': '2px solid red', - 'border-top-color': 'red', - 'border-top-style': 'solid', - 'border-top-width': '2px', - }, 'border: 2px solid red;'); - cssTest('border: red; border-left-color:', { - 'border-bottom': 'red', - 'border-bottom-color': 'red', - 'border-right': 'red', - 'border-right-color': 'red', - 'border-top': 'red', - 'border-top-color': 'red', - }, 'border-top: red; border-right: red; border-bottom: red;'); + cssTest( + 'border-top: red; border-right: red; border-bottom: red; border-left: red', + { + border: 'red', + 'border-bottom': 'red', + 'border-bottom-color': 'red', + 'border-left': 'red', + 'border-left-color': 'red', + 'border-right': 'red', + 'border-right-color': 'red', + 'border-top': 'red', + 'border-top-color': 'red', + }, + 'border: red;' + ); + cssTest( + 'border: 3px solid red; border-width: 2px', + { + border: '2px solid red', + 'border-bottom': '2px solid red', + 'border-bottom-color': 'red', + 'border-bottom-style': 'solid', + 'border-bottom-width': '2px', + 'border-left': '2px solid red', + 'border-left-color': 'red', + 'border-left-style': 'solid', + 'border-left-width': '2px', + 'border-right': '2px solid red', + 'border-right-color': 'red', + 'border-right-style': 'solid', + 'border-right-width': '2px', + 'border-top': '2px solid red', + 'border-top-color': 'red', + 'border-top-style': 'solid', + 'border-top-width': '2px', + }, + 'border: 2px solid red;' + ); + cssTest( + 'border: red; border-left-color:', + { + 'border-bottom': 'red', + 'border-bottom-color': 'red', + 'border-right': 'red', + 'border-right-color': 'red', + 'border-top': 'red', + 'border-top-color': 'red', + }, + 'border-top: red; border-right: red; border-bottom: red;' + ); cssTest('border-radius: 3px', { 'border-radius': '3px', }); @@ -318,79 +411,87 @@ describe('CssStyles object', () => { 'border-right-color': 'red', 'border-top-color': 'red', }); - cssTest('border-top: inset blue 2px; border: 3px solid red', { - 'border': '3px solid red', - 'border-top': '3px solid red', - 'border-top-color': 'red', - 'border-top-style': 'solid', - 'border-top-width': '3px', - 'border-right': '3px solid red', - 'border-right-color': 'red', - 'border-right-style': 'solid', - 'border-right-width': '3px', - 'border-bottom': '3px solid red', - 'border-bottom-color': 'red', - 'border-bottom-style': 'solid', - 'border-bottom-width': '3px', - 'border-left': '3px solid red', - 'border-left-color': 'red', - 'border-left-style': 'solid', - 'border-left-width': '3px', - }, 'border: 3px solid red;'); - cssTest('border-top-color: blue; border-top: 3px solid red', { - 'border-top': '3px solid red', - 'border-top-color': 'red', - 'border-top-style': 'solid', - 'border-top-width': '3px', - }, 'border-top: 3px solid red;'); + cssTest( + 'border-top: inset blue 2px; border: 3px solid red', + { + border: '3px solid red', + 'border-top': '3px solid red', + 'border-top-color': 'red', + 'border-top-style': 'solid', + 'border-top-width': '3px', + 'border-right': '3px solid red', + 'border-right-color': 'red', + 'border-right-style': 'solid', + 'border-right-width': '3px', + 'border-bottom': '3px solid red', + 'border-bottom-color': 'red', + 'border-bottom-style': 'solid', + 'border-bottom-width': '3px', + 'border-left': '3px solid red', + 'border-left-color': 'red', + 'border-left-style': 'solid', + 'border-left-width': '3px', + }, + 'border: 3px solid red;' + ); + cssTest( + 'border-top-color: blue; border-top: 3px solid red', + { + 'border-top': '3px solid red', + 'border-top-color': 'red', + 'border-top-style': 'solid', + 'border-top-width': '3px', + }, + 'border-top: 3px solid red;' + ); }); test('background', () => { cssTest('background: red; background-clip: none', { - 'background': 'red', + background: 'red', 'background-clip': 'none', }); }); test('font', () => { - cssFontTest('font-family: arial', {'font-family': 'arial'}); - cssFontTest('font-size: 120%', {'font-size': '120%'}); - cssFontTest('font-style: italic', {'font-style': 'italic'}); - cssFontTest('font-weight: bold', {'font-weight': 'bold'}); + cssFontTest('font-family: arial', { 'font-family': 'arial' }); + cssFontTest('font-size: 120%', { 'font-size': '120%' }); + cssFontTest('font-style: italic', { 'font-style': 'italic' }); + cssFontTest('font-weight: bold', { 'font-weight': 'bold' }); cssFontTest('font: arial 120%', { 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial 120%', { 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: 120% arial', { 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial small', { 'font-size': 'small', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial 16px', { 'font-size': '16px', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial bold 120%', { 'font-weight': 'bold', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial lighter 120%', { 'font-weight': 'lighter', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial italic 120%', { 'font-style': 'italic', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial bold italic 120%', { 'font-style': 'italic', @@ -401,43 +502,43 @@ describe('CssStyles object', () => { cssFontTest('font: arial full-width 120%', { 'font-variant': 'full-width', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial full-width simplified 120%', { 'font-variant': 'full-width simplified', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial condensed 120%', { 'font-stretch': 'condensed', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial semi-condensed 120%', { 'font-stretch': 'semi-condensed', 'font-size': '120%', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial small/.75', { 'line-height': '.75', 'font-size': 'small', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial small/12px', { 'line-height': '12px', 'font-size': 'small', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial small/75%', { 'line-height': '75%', 'font-size': 'small', - 'font-family': 'arial' + 'font-family': 'arial', }); cssFontTest('font: arial bold 120%; font-style: italic', { 'font-weight': 'bold', 'font-size': '120%', 'font-family': 'arial', - 'font-style': 'italic' + 'font-style': 'italic', }); cssFontTest('font-size-adjust: none', { 'font-size-adjust': 'none', @@ -465,5 +566,4 @@ describe('CssStyles object', () => { expect(styles.get('padding')).toBe(''); expect(styles.cssText).toBe(''); }); - }); diff --git a/testsuite/tests/util/asyncLoad/dirname.cjs b/testsuite/tests/util/asyncLoad/dirname.cjs index ad99475b4..0e9f6a557 100644 --- a/testsuite/tests/util/asyncLoad/dirname.cjs +++ b/testsuite/tests/util/asyncLoad/dirname.cjs @@ -1,3 +1,6 @@ const path = require('path'); -module.exports.dirname = path.resolve(__dirname, path.join('..', '..', '..', '..', 'mjs', 'util', 'asyncLoad')); +module.exports.dirname = path.resolve( + __dirname, + path.join('..', '..', '..', '..', 'mjs', 'util', 'asyncLoad') +); diff --git a/testsuite/tests/util/asyncLoad/dirname.mjs b/testsuite/tests/util/asyncLoad/dirname.mjs index 7d3b7205f..b0f6a5bf7 100644 --- a/testsuite/tests/util/asyncLoad/dirname.mjs +++ b/testsuite/tests/util/asyncLoad/dirname.mjs @@ -1,3 +1,3 @@ -import {dirname} from './dirname.cjs'; +import { dirname } from './dirname.cjs'; global.__dirname = dirname; diff --git a/testsuite/tests/util/asyncLoad/esm.test.ts b/testsuite/tests/util/asyncLoad/esm.test.ts index c29bcea23..7a1c36616 100644 --- a/testsuite/tests/util/asyncLoad/esm.test.ts +++ b/testsuite/tests/util/asyncLoad/esm.test.ts @@ -1,41 +1,50 @@ import { describe, test, expect } from '@jest/globals'; -import {mathjax} from '#js/mathjax.js'; -import {asyncLoad} from '#js/util/AsyncLoad.js'; -import {setBaseURL} from '#js/util/asyncLoad/esm.js'; +import { mathjax } from '#js/mathjax.js'; +import { asyncLoad } from '#js/util/AsyncLoad.js'; +import { setBaseURL } from '#js/util/asyncLoad/esm.js'; import * as path from 'path'; const root = path.resolve('..', 'mjs'); const lib = path.resolve('lib'); describe('asyncLoad() for esm', () => { - test('asyncLoad()', async () => { const cjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.cjs'); const mjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.mjs'); - const relUnknown = path.join('..', 'testsuite', 'lib', 'AsyncLoad.unknown.cjs'); + const relUnknown = path.join( + '..', + 'testsuite', + 'lib', + 'AsyncLoad.unknown.cjs' + ); const absFile = path.join(root, cjsFile); const absUnknown = path.join(root, relUnknown); - await expect(asyncLoad(cjsFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found - await expect(asyncLoad(absFile)).resolves.toEqual({loaded: true}); // absolute file found - await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found - - await expect(asyncLoad('#js/components/version.js') // load using package exports - .then((result: any) => result.VERSION)).resolves.toBe(mathjax.version); - await expect(asyncLoad('@mathjax/src/js/components/version.js') // load from module - .then((result: any) => result.VERSION)).resolves.toBe(mathjax.version); - - await expect(asyncLoad(mjsFile).then((result: any) => result.loaded)).resolves.toBe(true); // mjs file loads - expect(mathjax.asyncIsSynchronous).toBe(false); // esm.js is asynchronous + await expect(asyncLoad(cjsFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(absFile)).resolves.toEqual({ loaded: true }); // absolute file found + await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found + + await expect( + asyncLoad('#js/components/version.js') // load using package exports + .then((result: any) => result.VERSION) + ).resolves.toBe(mathjax.version); + await expect( + asyncLoad('@mathjax/src/js/components/version.js') // load from module + .then((result: any) => result.VERSION) + ).resolves.toBe(mathjax.version); + + await expect( + asyncLoad(mjsFile).then((result: any) => result.loaded) + ).resolves.toBe(true); // mjs file loads + expect(mathjax.asyncIsSynchronous).toBe(false); // esm.js is asynchronous }); test('setBaseURL() for esm', async () => { setBaseURL(lib); const relFile = './AsyncLoad.child.cjs'; const relUnknown = './AsyncLoad.unknown.cjs'; - await expect(asyncLoad(relFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(relFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found }); - }); diff --git a/testsuite/tests/util/asyncLoad/node.test.ts b/testsuite/tests/util/asyncLoad/node.test.ts index 3d7a6c080..08d995929 100644 --- a/testsuite/tests/util/asyncLoad/node.test.ts +++ b/testsuite/tests/util/asyncLoad/node.test.ts @@ -1,43 +1,50 @@ import { describe, test, expect } from '@jest/globals'; import './dirname.mjs'; import '#source/../require.mjs'; -import {mathjax} from '#js/mathjax.js'; -import {asyncLoad} from '#js/util/AsyncLoad.js'; -import {setBaseURL} from '#js/util/asyncLoad/node.js'; +import { mathjax } from '#js/mathjax.js'; +import { asyncLoad } from '#js/util/AsyncLoad.js'; +import { setBaseURL } from '#js/util/asyncLoad/node.js'; import * as path from 'path'; const root = path.dirname(path.dirname(__dirname)); const lib = path.resolve('lib'); describe('asyncLoad() for node', () => { - test('asyncLoad()', async () => { const cjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.cjs'); const mjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.mjs'); - const relUnknown = path.join('..', 'testsuite', 'lib', 'AsyncLoad.unknown.cjs'); + const relUnknown = path.join( + '..', + 'testsuite', + 'lib', + 'AsyncLoad.unknown.cjs' + ); const absFile = path.join(root, cjsFile); const absUnknown = path.join(root, relUnknown); - await expect(asyncLoad(cjsFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found - await expect(asyncLoad(absFile)).resolves.toEqual({loaded: true}); // absolute file found - await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found - - await expect(asyncLoad('#js/../cjs/components/version.js') // load using package exports - .then((result: any) => result.VERSION)).resolves.toBe(mathjax.version); - await expect(asyncLoad('@mathjax/src/js/components/version.js') // load from module - .then((result: any) => result.VERSION)).resolves.toBe(mathjax.version); - - await expect(asyncLoad(mjsFile).catch(() => true)).resolves.toBe(true); // mjs file fails - expect(mathjax.asyncIsSynchronous).toBe(true); // node.js is synchronous + await expect(asyncLoad(cjsFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(absFile)).resolves.toEqual({ loaded: true }); // absolute file found + await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found + + await expect( + asyncLoad('#js/../cjs/components/version.js') // load using package exports + .then((result: any) => result.VERSION) + ).resolves.toBe(mathjax.version); + await expect( + asyncLoad('@mathjax/src/js/components/version.js') // load from module + .then((result: any) => result.VERSION) + ).resolves.toBe(mathjax.version); + + await expect(asyncLoad(mjsFile).catch(() => true)).resolves.toBe(true); // mjs file fails + expect(mathjax.asyncIsSynchronous).toBe(true); // node.js is synchronous }); test('setBaseURL() for node', async () => { setBaseURL(lib); const relFile = './AsyncLoad.child.cjs'; const relUnknown = './AsyncLoad.unknown.cjs'; - await expect(asyncLoad(relFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(relFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found }); - }); diff --git a/testsuite/tests/util/asyncLoad/system.cjs b/testsuite/tests/util/asyncLoad/system.cjs index dc89d8baf..acc5ca0c9 100644 --- a/testsuite/tests/util/asyncLoad/system.cjs +++ b/testsuite/tests/util/asyncLoad/system.cjs @@ -6,6 +6,5 @@ const path = require('path'); System = { import(name, root) { return import(new URL(name, root).href); - } -} - + }, +}; diff --git a/testsuite/tests/util/asyncLoad/system.test.ts b/testsuite/tests/util/asyncLoad/system.test.ts index b97626b7b..160b876a5 100644 --- a/testsuite/tests/util/asyncLoad/system.test.ts +++ b/testsuite/tests/util/asyncLoad/system.test.ts @@ -1,43 +1,52 @@ import { describe, test, expect } from '@jest/globals'; import './dirname.mjs'; import './system.cjs'; -import {mathjax} from '#js/mathjax.js'; -import {asyncLoad} from '#js/util/AsyncLoad.js'; -import {setBaseURL} from '#js/util/asyncLoad/system.js'; +import { mathjax } from '#js/mathjax.js'; +import { asyncLoad } from '#js/util/AsyncLoad.js'; +import { setBaseURL } from '#js/util/asyncLoad/system.js'; import * as path from 'path'; const root = path.resolve('..', 'mjs'); const lib = path.resolve('lib'); describe('asyncLoad() for node', () => { - test('asyncLoad()', async () => { const cjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.cjs'); const mjsFile = path.join('..', 'testsuite', 'lib', 'AsyncLoad.child.mjs'); - const relUnknown = path.join('..', 'testsuite', 'lib', 'AsyncLoad.unknown.cjs'); + const relUnknown = path.join( + '..', + 'testsuite', + 'lib', + 'AsyncLoad.unknown.cjs' + ); const absFile = path.join(root, cjsFile); const absUnknown = path.join(root, relUnknown); - await expect(asyncLoad(cjsFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found - await expect(asyncLoad(absFile)).resolves.toEqual({loaded: true}); // absolute file found - await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found - - await expect(asyncLoad('#js/components/version.js') // can't load using package exports - .catch(() => true)).resolves.toBe(true); - await expect(asyncLoad('mathjax-full/js/components/version.js') // can't load from module - .catch(() => true)).resolves.toBe(true); - - await expect(asyncLoad(mjsFile).then((result: any) => result.loaded)).resolves.toBe(true); // mjs file loads - expect(mathjax.asyncIsSynchronous).toBe(false); // system.js is asynchronous + await expect(asyncLoad(cjsFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(absFile)).resolves.toEqual({ loaded: true }); // absolute file found + await expect(asyncLoad(absUnknown).catch(() => true)).resolves.toBe(true); // absolute file not found + + await expect( + asyncLoad('#js/components/version.js') // can't load using package exports + .catch(() => true) + ).resolves.toBe(true); + await expect( + asyncLoad('mathjax-full/js/components/version.js') // can't load from module + .catch(() => true) + ).resolves.toBe(true); + + await expect( + asyncLoad(mjsFile).then((result: any) => result.loaded) + ).resolves.toBe(true); // mjs file loads + expect(mathjax.asyncIsSynchronous).toBe(false); // system.js is asynchronous }); test('setBaseURL() for node', async () => { setBaseURL(lib); const relFile = './AsyncLoad.child.cjs'; const relUnknown = './AsyncLoad.unknown.cjs'; - await expect(asyncLoad(relFile)).resolves.toEqual({loaded: true}); // relative file found - await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found + await expect(asyncLoad(relFile)).resolves.toEqual({ loaded: true }); // relative file found + await expect(asyncLoad(relUnknown).catch(() => true)).resolves.toBe(true); // relative file not found }); - }); diff --git a/testsuite/tests/util/length.test.ts b/testsuite/tests/util/length.test.ts index 5bbd6e796..1d5b37c30 100644 --- a/testsuite/tests/util/length.test.ts +++ b/testsuite/tests/util/length.test.ts @@ -21,7 +21,8 @@ describe('Dimension conversion from length', () => { it('9mu', () => expect(convertLengthDim('9mu')).toBe(0.5)); it('9%', () => expect(convertLengthDim('9%')).toBe(0)); it('number 9', () => expect(convertLengthDim(9)).toBe(0)); - it('thinmathspace', () => expect(convertLengthDim('thinmathspace')).toBe(3/18)); + it('thinmathspace', () => + expect(convertLengthDim('thinmathspace')).toBe(3 / 18)); it('em', () => expect(convertLengthDim('em')).toBe(1)); }); @@ -37,29 +38,33 @@ describe('Dimension conversion with default', () => { describe('Dimension conversion with scale', () => { it('9px', () => expect(Length.length2em('9px', 0, 2)).toBe(0.5625 / 2)); it('9in', () => expect(Length.length2em('9in', 0, 2)).toBe(54 / 2)); - it('9cm', () => expect(Length.length2em('9cm', 0, 2)).toBe(21.259842519685037 / 2)); - it('9mm', () => expect(Length.length2em('9mm', 0, 2)).toBe(2.125984251968504 / 2)); + it('9cm', () => + expect(Length.length2em('9cm', 0, 2)).toBe(21.259842519685037 / 2)); + it('9mm', () => + expect(Length.length2em('9mm', 0, 2)).toBe(2.125984251968504 / 2)); }); describe('Dimension conversion with scale', () => { it('9px', () => expect(Length.length2em('9px', 0, 1, 8)).toBe(0.5625 * 2)); it('9in', () => expect(Length.length2em('9in', 0, 1, 8)).toBe(54 * 2)); - it('9cm', () => expect(Length.length2em('9cm', 0, 1, 8)).toBe(21.259842519685037 * 2)); - it('9mm', () => expect(Length.length2em('9mm', 0, 1, 8)).toBe(2.125984251968504 * 2)); + it('9cm', () => + expect(Length.length2em('9cm', 0, 1, 8)).toBe(21.259842519685037 * 2)); + it('9mm', () => + expect(Length.length2em('9mm', 0, 1, 8)).toBe(2.125984251968504 * 2)); }); describe('percent()', () => { - it('.75', () => expect(Length.percent(.75)).toBe('75%')); + it('.75', () => expect(Length.percent(0.75)).toBe('75%')); it('1.75', () => expect(Length.percent(1.75)).toBe('175%')); - it('.754321', () => expect(Length.percent(.754321)).toBe('75.4%')); + it('.754321', () => expect(Length.percent(0.754321)).toBe('75.4%')); it('1.754321', () => expect(Length.percent(1.754321)).toBe('175.4%')); it('1', () => expect(Length.percent(1)).toBe('100%')); }); describe('em()', () => { - it('.75', () => expect(Length.em(.75)).toBe('0.75em')); + it('.75', () => expect(Length.em(0.75)).toBe('0.75em')); it('1.75', () => expect(Length.em(1.75)).toBe('1.75em')); - it('.754321', () => expect(Length.em(.754321)).toBe('0.754em')); + it('.754321', () => expect(Length.em(0.754321)).toBe('0.754em')); it('1.754321', () => expect(Length.em(1.754321)).toBe('1.754em')); it('1', () => expect(Length.em(1)).toBe('1em')); it('0', () => expect(Length.em(0)).toBe('0')); @@ -67,9 +72,9 @@ describe('em()', () => { }); describe('px()', () => { - it('.75', () => expect(Length.px(.75)).toBe('12px')); + it('.75', () => expect(Length.px(0.75)).toBe('12px')); it('1.75', () => expect(Length.px(1.75)).toBe('28px')); - it('.754321', () => expect(Length.px(.754321)).toBe('12.1px')); + it('.754321', () => expect(Length.px(0.754321)).toBe('12.1px')); it('1.754321', () => expect(Length.px(1.754321)).toBe('28.1px')); it('1', () => expect(Length.px(1)).toBe('16px')); it('0', () => expect(Length.px(0)).toBe('0')); diff --git a/testsuite/tests/util/numeric.test.ts b/testsuite/tests/util/numeric.test.ts index 45cfd3949..173ae164b 100644 --- a/testsuite/tests/util/numeric.test.ts +++ b/testsuite/tests/util/numeric.test.ts @@ -2,7 +2,6 @@ import { describe, test, expect } from '@jest/globals'; import * as numeric from '#js/util/numeric.js'; describe('numeric functions', () => { - test('sum', () => { expect(numeric.sum([1, 2, 3, 4, 5])).toBe(15); expect(numeric.sum([])).toBe(0); @@ -12,5 +11,4 @@ describe('numeric functions', () => { expect(numeric.max([5, 2, 10, 3, 50, -5])).toBe(50); expect(numeric.max([])).toBe(0); }); - }); diff --git a/testsuite/tests/util/string.test.ts b/testsuite/tests/util/string.test.ts index eff65512e..6a4ff4f1e 100644 --- a/testsuite/tests/util/string.test.ts +++ b/testsuite/tests/util/string.test.ts @@ -2,28 +2,44 @@ import { describe, test, expect } from '@jest/globals'; import * as string from '#js/util/string.js'; describe('string functions', () => { - test('sortLength()', () => { - expect(['a', '', 'aaa', 'aa'].sort(string.sortLength)).toEqual(['aaa', 'aa', 'a', '']); - expect(['a', '', 'aaa', 'a', 'aa'].sort(string.sortLength)).toEqual(['aaa', 'aa', 'a', 'a', '']); - expect(['a', 'ccc', '', 'aaa', 'bb', 'aa', 'bbb'].sort(string.sortLength)).toEqual( - ['aaa', 'bbb', 'ccc', 'aa', 'bb', 'a', ''] - ); + expect(['a', '', 'aaa', 'aa'].sort(string.sortLength)).toEqual([ + 'aaa', + 'aa', + 'a', + '', + ]); + expect(['a', '', 'aaa', 'a', 'aa'].sort(string.sortLength)).toEqual([ + 'aaa', + 'aa', + 'a', + 'a', + '', + ]); + expect( + ['a', 'ccc', '', 'aaa', 'bb', 'aa', 'bbb'].sort(string.sortLength) + ).toEqual(['aaa', 'bbb', 'ccc', 'aa', 'bb', 'a', '']); expect(['a'].sort(string.sortLength)).toEqual(['a']); expect([].sort(string.sortLength)).toEqual([]); }); test('quotePattern()', () => { - expect(string.quotePattern('[({.*+?^$-|:\\})]')).toBe('\\[\\(\\{\\.\\*\\+\\?\\^\\$\\-\\|\\:\\\\\\}\\)\\]'); + expect(string.quotePattern('[({.*+?^$-|:\\})]')).toBe( + '\\[\\(\\{\\.\\*\\+\\?\\^\\$\\-\\|\\:\\\\\\}\\)\\]' + ); }); test('unicodeChars()', () => { - expect(string.unicodeChars('aA\u00AA\u2212\uFFFD\u{1D410}')).toEqual([0x61, 0x41, 0xAA, 0x2212, 0xFFFD, 0x1D410]); + expect(string.unicodeChars('aA\u00AA\u2212\uFFFD\u{1D410}')).toEqual([ + 0x61, 0x41, 0xaa, 0x2212, 0xfffd, 0x1d410, + ]); expect(string.unicodeChars('')).toEqual([]); }); test('uncideString()', () => { - expect(string.unicodeString([0x61, 0x41, 0xAA, 0x2212, 0xFFFD, 0x1D410])).toBe('aA\u00AA\u2212\uFFFD\u{1D410}'); + expect( + string.unicodeString([0x61, 0x41, 0xaa, 0x2212, 0xfffd, 0x1d410]) + ).toBe('aA\u00AA\u2212\uFFFD\u{1D410}'); expect(string.unicodeString([])).toBe(''); }); @@ -52,16 +68,23 @@ describe('string functions', () => { expect(string.replaceUnicode(String.raw`a \U{62} c`)).toBe('a b c'); expect(string.replaceUnicode(String.raw`\\U{61}`)).toBe(String.raw`\U{61}`); expect(string.replaceUnicode(String.raw`\\\U{61}`)).toBe(String.raw`\a`); - expect(string.replaceUnicode(String.raw`\\\\U{61}`)).toBe(String.raw`\\U{61}`); + expect(string.replaceUnicode(String.raw`\\\\U{61}`)).toBe( + String.raw`\\U{61}` + ); expect(string.replaceUnicode(String.raw`\\\\\U{61}`)).toBe(String.raw`\\a`); - expect(string.replaceUnicode(String.raw`x\\U{61}`)).toBe(String.raw`x\U{61}`); + expect(string.replaceUnicode(String.raw`x\\U{61}`)).toBe( + String.raw`x\U{61}` + ); expect(string.replaceUnicode(String.raw`x\\\U{61}`)).toBe(String.raw`x\a`); - expect(string.replaceUnicode(String.raw`x\\\\U{61}`)).toBe(String.raw`x\\U{61}`); - expect(string.replaceUnicode(String.raw`x\\\\\U{61}`)).toBe(String.raw`x\\a`); + expect(string.replaceUnicode(String.raw`x\\\\U{61}`)).toBe( + String.raw`x\\U{61}` + ); + expect(string.replaceUnicode(String.raw`x\\\\\U{61}`)).toBe( + String.raw`x\\a` + ); }); test('toEntity()', () => { expect(string.toEntity('\u200B')).toBe('​'); }); - });