Skip to content

Commit

Permalink
esm, vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed Oct 30, 2024
1 parent 106b0b1 commit f5a6537
Show file tree
Hide file tree
Showing 62 changed files with 1,365 additions and 2,393 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
presets: ["@babel/preset-env"],
plugins: ["angularjs-annotate"],
};
8 changes: 4 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import globals from "globals";
import jest from "eslint-plugin-jest";
import vitest from "eslint-plugin-vitest";
import js from "@eslint/js";

export default [
Expand All @@ -24,15 +24,15 @@ export default [
files: ["**/*.spec.js"],

languageOptions: {
globals: jest.environments.globals.globals,
globals: vitest.environments.env.globals,
},

plugins: {
jest,
vitest,
},

rules: {
"jest/prefer-expect-assertions": "off",
...vitest.configs.recommended.rules,
},
},
];
5 changes: 0 additions & 5 deletions importMock.js

This file was deleted.

11 changes: 0 additions & 11 deletions jest.config.js

This file was deleted.

29 changes: 3 additions & 26 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
// This file is an entry point for angular tests
// Avoids some weird issues when using webpack + angular.
window.jasmine = true;
window.VERSION = {};
window.process = {
env: {},
};
import "angular";
import "angular-mocks/angular-mocks";

require("jest-fetch-mock").enableMocks();

// https://github.com/pouchdb/pouchdb/issues/8383
window.setImmediate = (fn) => {
setTimeout(fn, 0);
};
window.process.nextTick = (fn) => {
setTimeout(fn, 0);
};

require("angular");
require("angular-mocks/angular-mocks");

const PouchDB = require("pouchdb-browser");
const memory = require("pouchdb-adapter-memory");

PouchDB.plugin(memory);

require("./src/scripts/app");
import "./src/scripts/app.js";
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "financier",
"private": true,
"type": "module",
"version": "1.8.1",
"releaseDate": "2022-04-24",
"description": "Straightforward budgeting",
Expand All @@ -10,9 +11,8 @@
"server": "webpack-dev-server --history-api-fallback --hot --progress",
"lint": "eslint --max-warnings=0 src/",
"format": "prettier --check src/",
"test": "jest",
"test-watch": "jest --watch",
"test-coverage": "jest --coverage",
"test": "vitest",
"test-coverage": "vitest --coverage",
"start": "pnpm run server",
"docs": "jsdoc --configure .jsdoc.json",
"pull": "docker pull ghcr.io/financier-io/financier",
Expand Down Expand Up @@ -41,15 +41,12 @@
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"eslint": "^9.13.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-vitest": "^0.5.4",
"financier-docdash": "^0.7.0",
"globals": "^15.11.0",
"helmet-csp": "^4.0.0",
"html-loader": "^5.1.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"jsdoc": "^4.0.4",
"mini-css-extract-plugin": "^2.6.0",
"nocache": "^4.0.0",
Expand All @@ -61,6 +58,7 @@
"sass": "^1.50.1",
"sass-loader": "^16.0.2",
"style-loader": "^4.0.0",
"vitest": "^2.1.4",
"webpack": "^5.72.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
Expand Down Expand Up @@ -107,7 +105,8 @@
"st-multi-sort": "^1.1.2",
"tether-drop": "^1.4.2",
"underscore": "^1.13.2",
"uuid": "^11.0.2"
"uuid": "^11.0.2",
"vitest-angular-mocks": "github:aeharding/vitest-angular-mocks"
},
"pnpm": {
"allowedDeprecatedVersions": {
Expand Down
Loading

0 comments on commit f5a6537

Please sign in to comment.