From adfd339edb61cfd14f4cef8a9f5433e2c9e21009 Mon Sep 17 00:00:00 2001 From: Gabriel Tan-Chen Date: Fri, 22 Nov 2024 17:07:14 -0500 Subject: [PATCH] Convert to ES6 modules --- .../attachment-ctrl/create-attachment.js | 6 +- .../attachment-ctrl/delete-attachment.js | 8 +- app/controllers/attachment-ctrl/index.js | 16 +- .../attachment-ctrl/update-attachment.js | 6 +- .../attachment-ctrl/upload-attachment.js | 12 +- app/controllers/audit-ctrl/index.js | 12 +- app/controllers/audit-ctrl/track-changes.js | 4 +- .../audit-ctrl/track-instance-destroy.js | 4 +- .../audit-ctrl/track-instance-update.js | 4 +- .../audit-ctrl/track-new-instance.js | 4 +- app/controllers/budget-ctrl/create-budget.js | 8 +- app/controllers/budget-ctrl/delete-budget.js | 6 +- app/controllers/budget-ctrl/index.js | 10 +- app/controllers/budget-ctrl/update-budget.js | 8 +- .../category-ctrl/create-category.js | 6 +- .../category-ctrl/create-subcategory.js | 6 +- .../category-ctrl/delete-category.js | 6 +- .../category-ctrl/delete-subcategory.js | 6 +- app/controllers/category-ctrl/index.js | 16 +- .../category-ctrl/update-category.js | 6 +- .../category-ctrl/update-subcategory.js | 6 +- .../employer-ctrl/create-employer.js | 6 +- .../employer-ctrl/delete-employer.js | 6 +- app/controllers/employer-ctrl/index.js | 10 +- .../employer-ctrl/update-employer.js | 6 +- .../expense-ctrl/create-expense.js | 10 +- .../expense-ctrl/delete-expense.js | 8 +- app/controllers/expense-ctrl/index.js | 10 +- .../expense-ctrl/update-expense.js | 10 +- app/controllers/fund-ctrl/create-deposit.js | 8 +- app/controllers/fund-ctrl/create-fund.js | 6 +- app/controllers/fund-ctrl/delete-deposit.js | 6 +- app/controllers/fund-ctrl/delete-fund.js | 6 +- app/controllers/fund-ctrl/index.js | 18 +- app/controllers/fund-ctrl/update-deposit.js | 8 +- app/controllers/fund-ctrl/update-fund.js | 6 +- .../household-ctrl/create-member.js | 6 +- .../household-ctrl/delete-member.js | 6 +- app/controllers/household-ctrl/index.js | 10 +- .../household-ctrl/update-member.js | 6 +- app/controllers/income-ctrl/create-income.js | 10 +- app/controllers/income-ctrl/delete-income.js | 6 +- app/controllers/income-ctrl/index.js | 10 +- app/controllers/income-ctrl/update-income.js | 10 +- app/controllers/index.js | 28 +- .../loan-ctrl/create-loan-payment.js | 8 +- app/controllers/loan-ctrl/create-loan.js | 6 +- .../loan-ctrl/delete-loan-payment.js | 6 +- app/controllers/loan-ctrl/delete-loan.js | 6 +- app/controllers/loan-ctrl/index.js | 18 +- .../loan-ctrl/update-loan-payment.js | 8 +- app/controllers/loan-ctrl/update-loan.js | 6 +- .../user-ctrl/add-user-to-household.js | 10 +- app/controllers/user-ctrl/get-token.js | 8 +- app/controllers/user-ctrl/index.js | 16 +- .../user-ctrl/login-with-password.js | 6 +- app/controllers/user-ctrl/login-with-token.js | 6 +- app/controllers/user-ctrl/sign-up.js | 10 +- .../user-ctrl/update-user-details.js | 8 +- app/controllers/vendor-ctrl/create-vendor.js | 6 +- app/controllers/vendor-ctrl/delete-vendor.js | 6 +- app/controllers/vendor-ctrl/index.js | 10 +- app/controllers/vendor-ctrl/update-vendor.js | 6 +- app/index.js | 39 +- app/middleware/auditor/index.js | 4 +- app/middleware/authentication/index.js | 8 +- .../error-handler/attachment-error.js | 2 +- app/middleware/error-handler/audit-error.js | 2 +- app/middleware/error-handler/budget-error.js | 2 +- .../error-handler/category-error.js | 2 +- .../error-handler/employer-error.js | 2 +- app/middleware/error-handler/expense-error.js | 2 +- app/middleware/error-handler/fund-error.js | 2 +- .../error-handler/household-error.js | 2 +- app/middleware/error-handler/income-error.js | 2 +- app/middleware/error-handler/index.js | 443 ++++++++++++++++-- app/middleware/error-handler/loan-error.js | 2 +- .../login-password-failed-error.js | 2 +- app/middleware/error-handler/user-error.js | 2 +- app/middleware/error-handler/vendor-error.js | 2 +- app/middleware/index.js | 15 +- app/middleware/validator/index.js | 10 +- app/models/attachment.js | 4 +- app/models/audit/api-call.js | 4 +- app/models/audit/change.js | 4 +- app/models/audit/index.js | 8 +- app/models/audit/log.js | 4 +- app/models/budget.js | 4 +- app/models/category.js | 4 +- app/models/deposit.js | 4 +- app/models/employer.js | 4 +- app/models/expense.js | 4 +- app/models/fund.js | 4 +- app/models/hash.js | 4 +- app/models/household-member.js | 4 +- app/models/household.js | 4 +- app/models/income.js | 4 +- app/models/index.js | 48 +- app/models/loan-payment.js | 4 +- app/models/loan.js | 4 +- app/models/subcategory.js | 4 +- app/models/user-login.js | 4 +- app/models/user.js | 4 +- app/models/vendor.js | 4 +- app/routes/attachments/get.js | 8 +- app/routes/attachments/index.js | 10 +- app/routes/attachments/item/delete.js | 2 +- app/routes/attachments/item/get.js | 8 +- app/routes/attachments/item/index.js | 12 +- app/routes/attachments/item/patch.js | 2 +- app/routes/attachments/item/upload/index.js | 6 +- app/routes/attachments/item/upload/post.js | 2 +- app/routes/attachments/post.js | 2 +- app/routes/budget-reports/get.js | 6 +- app/routes/budget-reports/index.js | 4 +- app/routes/budgets/get.js | 4 +- app/routes/budgets/index.js | 10 +- app/routes/budgets/item/delete.js | 2 +- app/routes/budgets/item/get.js | 4 +- app/routes/budgets/item/index.js | 10 +- app/routes/budgets/item/patch.js | 2 +- app/routes/budgets/post.js | 2 +- app/routes/categories/get.js | 2 +- app/routes/categories/index.js | 10 +- app/routes/categories/item/delete.js | 2 +- app/routes/categories/item/get.js | 6 +- app/routes/categories/item/index.js | 10 +- app/routes/categories/item/patch.js | 2 +- app/routes/categories/post.js | 2 +- app/routes/deposits/get.js | 4 +- app/routes/deposits/index.js | 10 +- app/routes/deposits/item/delete.js | 2 +- app/routes/deposits/item/get.js | 4 +- app/routes/deposits/item/index.js | 10 +- app/routes/deposits/item/patch.js | 2 +- app/routes/deposits/post.js | 2 +- app/routes/employers/get.js | 4 +- app/routes/employers/index.js | 10 +- app/routes/employers/item/delete.js | 2 +- app/routes/employers/item/get.js | 4 +- app/routes/employers/item/index.js | 10 +- app/routes/employers/item/patch.js | 2 +- app/routes/employers/post.js | 2 +- app/routes/expenses/get.js | 6 +- app/routes/expenses/index.js | 10 +- app/routes/expenses/item/delete.js | 2 +- app/routes/expenses/item/get.js | 4 +- app/routes/expenses/item/index.js | 10 +- app/routes/expenses/item/patch.js | 2 +- app/routes/expenses/post.js | 2 +- app/routes/funds/get.js | 4 +- app/routes/funds/index.js | 10 +- app/routes/funds/item/delete.js | 2 +- app/routes/funds/item/get.js | 4 +- app/routes/funds/item/index.js | 10 +- app/routes/funds/item/patch.js | 2 +- app/routes/funds/post.js | 2 +- app/routes/household-members/get.js | 4 +- app/routes/household-members/index.js | 10 +- app/routes/household-members/item/delete.js | 2 +- app/routes/household-members/item/get.js | 4 +- app/routes/household-members/item/index.js | 10 +- app/routes/household-members/item/patch.js | 2 +- app/routes/household-members/post.js | 2 +- app/routes/households/index.js | 4 +- app/routes/households/item/get.js | 2 +- app/routes/households/item/index.js | 4 +- app/routes/incomes/get.js | 6 +- app/routes/incomes/index.js | 10 +- app/routes/incomes/item/delete.js | 2 +- app/routes/incomes/item/get.js | 4 +- app/routes/incomes/item/index.js | 10 +- app/routes/incomes/item/patch.js | 2 +- app/routes/incomes/post.js | 2 +- app/routes/index.js | 40 +- app/routes/loan-payments/get.js | 4 +- app/routes/loan-payments/index.js | 10 +- app/routes/loan-payments/item/delete.js | 2 +- app/routes/loan-payments/item/get.js | 4 +- app/routes/loan-payments/item/index.js | 10 +- app/routes/loan-payments/item/patch.js | 2 +- app/routes/loan-payments/post.js | 2 +- app/routes/loans/get.js | 4 +- app/routes/loans/index.js | 10 +- app/routes/loans/item/delete.js | 2 +- app/routes/loans/item/get.js | 4 +- app/routes/loans/item/index.js | 10 +- app/routes/loans/item/patch.js | 2 +- app/routes/loans/post.js | 2 +- app/routes/monthly-reports/index.js | 4 +- app/routes/monthly-reports/item/get.js | 6 +- app/routes/monthly-reports/item/index.js | 4 +- app/routes/subcategories/get.js | 6 +- app/routes/subcategories/index.js | 10 +- app/routes/subcategories/item/delete.js | 2 +- app/routes/subcategories/item/get.js | 4 +- app/routes/subcategories/item/index.js | 10 +- app/routes/subcategories/item/patch.js | 2 +- app/routes/subcategories/post.js | 2 +- app/routes/subcategory-annual-reports/get.js | 6 +- .../subcategory-annual-reports/index.js | 6 +- .../subcategory-annual-reports/item/get.js | 6 +- .../subcategory-annual-reports/item/index.js | 4 +- app/routes/users/get.js | 2 +- app/routes/users/index.js | 12 +- app/routes/users/item/get.js | 2 +- app/routes/users/item/index.js | 8 +- app/routes/users/item/patch.js | 2 +- app/routes/users/login/index.js | 8 +- app/routes/users/login/post.js | 2 +- app/routes/users/login/token/index.js | 6 +- app/routes/users/login/token/post.js | 2 +- app/routes/users/post.js | 2 +- app/routes/vendors/get.js | 4 +- app/routes/vendors/index.js | 10 +- app/routes/vendors/item/delete.js | 2 +- app/routes/vendors/item/get.js | 4 +- app/routes/vendors/item/index.js | 10 +- app/routes/vendors/item/patch.js | 2 +- app/routes/vendors/post.js | 2 +- config/index.js | 4 +- index.js | 8 +- .../20180616141519-create-households-table.js | 8 +- .../20180616190408-create-users-table.js | 4 +- ...20180618112229-create-user-logins-table.js | 4 +- .../20180618230743-create-hashes-table.js | 4 +- ...0619100433-create-audit-api-calls-table.js | 4 +- .../20180619173136-create-audit-logs-table.js | 4 +- ...180620110720-create-audit-changes-table.js | 4 +- .../20180629122108-create-categories-table.js | 4 +- .../20180927104854-create-vendors-table.js | 4 +- .../20181010001231-create-expenses-table.js | 4 +- ...08230400-create-household-members-table.js | 4 +- ...household-member-uuid-to-expenses-table.js | 4 +- ...emove-parent-uuid-from-categories-table.js | 4 +- ...191126191946-create-subcategories-table.js | 4 +- ...emove-category-uuid-from-expenses-table.js | 4 +- ...-add-subcategory-uuid-to-expenses-table.js | 4 +- .../20191215221256-create-budgets-table.js | 4 +- .../20200119230722-create-incomes-table.js | 4 +- ...200608114312-rename-budget-amount-cents.js | 4 +- .../20210627163729-create-funds-table.js | 4 +- .../20210627165909-create-deposits-table.js | 4 +- ...7172249-add-fund-uuid-to-expenses-table.js | 4 +- ...220305173901-add-notes-to-budgets-table.js | 4 +- ...20220324014129-create-attachments-table.js | 4 +- ...213033341-alter-attachments-size-bigint.js | 5 +- .../20230629214327-create-loans-table.js | 4 +- ...230722043052-create-loan-payments-table.js | 4 +- .../20240217195721-create-employers-table.js | 4 +- ...0511-add-employer-uuid-to-incomes-table.js | 4 +- package.json | 1 + tests/integration/attachments/delete-test.js | 6 +- tests/integration/attachments/get-test.js | 12 +- .../attachments/item/delete-test.js | 10 +- .../integration/attachments/item/get-test.js | 10 +- .../attachments/item/options-test.js | 8 +- .../attachments/item/patch-test.js | 10 +- .../integration/attachments/item/post-test.js | 8 +- .../attachments/item/upload/delete-test.js | 8 +- .../attachments/item/upload/get-test.js | 8 +- .../attachments/item/upload/options-test.js | 8 +- .../attachments/item/upload/patch-test.js | 8 +- .../attachments/item/upload/post-test.js | 12 +- tests/integration/attachments/options-test.js | 6 +- tests/integration/attachments/patch-test.js | 6 +- tests/integration/attachments/post-test.js | 10 +- .../integration/budget-reports/delete-test.js | 6 +- tests/integration/budget-reports/get-test.js | 10 +- .../budget-reports/item/delete-test.js | 8 +- .../budget-reports/item/get-test.js | 8 +- .../budget-reports/item/options-test.js | 8 +- .../budget-reports/item/patch-test.js | 8 +- .../budget-reports/item/post-test.js | 8 +- .../budget-reports/options-test.js | 6 +- .../integration/budget-reports/patch-test.js | 6 +- tests/integration/budget-reports/post-test.js | 6 +- tests/integration/budgets/delete-test.js | 6 +- tests/integration/budgets/get-test.js | 12 +- tests/integration/budgets/item/delete-test.js | 10 +- tests/integration/budgets/item/get-test.js | 8 +- .../integration/budgets/item/options-test.js | 8 +- tests/integration/budgets/item/patch-test.js | 10 +- tests/integration/budgets/item/post-test.js | 8 +- tests/integration/budgets/options-test.js | 6 +- tests/integration/budgets/patch-test.js | 6 +- tests/integration/budgets/post-test.js | 10 +- tests/integration/categories/delete-test.js | 6 +- tests/integration/categories/get-test.js | 8 +- .../categories/item/delete-test.js | 10 +- tests/integration/categories/item/get-test.js | 8 +- .../categories/item/options-test.js | 8 +- .../integration/categories/item/patch-test.js | 10 +- .../integration/categories/item/post-test.js | 8 +- tests/integration/categories/options-test.js | 6 +- tests/integration/categories/patch-test.js | 6 +- tests/integration/categories/post-test.js | 10 +- tests/integration/delete-test.js | 6 +- tests/integration/deposits/delete-test.js | 6 +- tests/integration/deposits/get-test.js | 12 +- .../integration/deposits/item/delete-test.js | 10 +- tests/integration/deposits/item/get-test.js | 8 +- .../integration/deposits/item/options-test.js | 8 +- tests/integration/deposits/item/patch-test.js | 10 +- tests/integration/deposits/item/post-test.js | 8 +- tests/integration/deposits/options-test.js | 6 +- tests/integration/deposits/patch-test.js | 6 +- tests/integration/deposits/post-test.js | 10 +- tests/integration/employers/delete-test.js | 6 +- tests/integration/employers/get-test.js | 8 +- .../integration/employers/item/delete-test.js | 10 +- tests/integration/employers/item/get-test.js | 8 +- .../employers/item/options-test.js | 8 +- .../integration/employers/item/patch-test.js | 10 +- tests/integration/employers/item/post-test.js | 8 +- tests/integration/employers/options-test.js | 6 +- tests/integration/employers/patch-test.js | 6 +- tests/integration/employers/post-test.js | 10 +- tests/integration/expenses/delete-test.js | 6 +- tests/integration/expenses/get-test.js | 16 +- .../integration/expenses/item/delete-test.js | 10 +- tests/integration/expenses/item/get-test.js | 8 +- .../integration/expenses/item/options-test.js | 8 +- tests/integration/expenses/item/patch-test.js | 10 +- tests/integration/expenses/item/post-test.js | 8 +- tests/integration/expenses/options-test.js | 6 +- tests/integration/expenses/patch-test.js | 6 +- tests/integration/expenses/post-test.js | 10 +- tests/integration/funds/delete-test.js | 6 +- tests/integration/funds/get-test.js | 8 +- tests/integration/funds/item/delete-test.js | 10 +- tests/integration/funds/item/get-test.js | 8 +- tests/integration/funds/item/options-test.js | 8 +- tests/integration/funds/item/patch-test.js | 10 +- tests/integration/funds/item/post-test.js | 8 +- tests/integration/funds/options-test.js | 6 +- tests/integration/funds/patch-test.js | 6 +- tests/integration/funds/post-test.js | 10 +- tests/integration/get-test.js | 6 +- .../household-members/delete-test.js | 6 +- .../integration/household-members/get-test.js | 8 +- .../household-members/item/delete-test.js | 10 +- .../household-members/item/get-test.js | 8 +- .../household-members/item/options-test.js | 8 +- .../household-members/item/patch-test.js | 10 +- .../household-members/item/post-test.js | 8 +- .../household-members/options-test.js | 6 +- .../household-members/patch-test.js | 6 +- .../household-members/post-test.js | 10 +- tests/integration/households/delete-test.js | 6 +- tests/integration/households/get-test.js | 6 +- .../households/item/delete-test.js | 8 +- tests/integration/households/item/get-test.js | 8 +- .../households/item/options-test.js | 8 +- .../integration/households/item/patch-test.js | 8 +- .../integration/households/item/post-test.js | 8 +- tests/integration/households/options-test.js | 6 +- tests/integration/households/patch-test.js | 6 +- tests/integration/households/post-test.js | 6 +- tests/integration/incomes/delete-test.js | 6 +- tests/integration/incomes/get-test.js | 16 +- tests/integration/incomes/item/delete-test.js | 10 +- tests/integration/incomes/item/get-test.js | 8 +- .../integration/incomes/item/options-test.js | 8 +- tests/integration/incomes/item/patch-test.js | 10 +- tests/integration/incomes/item/post-test.js | 8 +- tests/integration/incomes/options-test.js | 6 +- tests/integration/incomes/patch-test.js | 6 +- tests/integration/incomes/post-test.js | 10 +- .../integration/loan-payments/delete-test.js | 6 +- tests/integration/loan-payments/get-test.js | 12 +- .../loan-payments/item/delete-test.js | 10 +- .../loan-payments/item/get-test.js | 8 +- .../loan-payments/item/options-test.js | 8 +- .../loan-payments/item/patch-test.js | 10 +- .../loan-payments/item/post-test.js | 8 +- .../integration/loan-payments/options-test.js | 6 +- tests/integration/loan-payments/patch-test.js | 6 +- tests/integration/loan-payments/post-test.js | 10 +- tests/integration/loans/delete-test.js | 6 +- tests/integration/loans/get-test.js | 8 +- tests/integration/loans/item/delete-test.js | 10 +- tests/integration/loans/item/get-test.js | 8 +- tests/integration/loans/item/options-test.js | 8 +- tests/integration/loans/item/patch-test.js | 10 +- tests/integration/loans/item/post-test.js | 8 +- tests/integration/loans/options-test.js | 6 +- tests/integration/loans/patch-test.js | 6 +- tests/integration/loans/post-test.js | 10 +- .../monthly-reports/delete-test.js | 6 +- tests/integration/monthly-reports/get-test.js | 6 +- .../monthly-reports/item/delete-test.js | 8 +- .../monthly-reports/item/get-test.js | 8 +- .../monthly-reports/item/options-test.js | 8 +- .../monthly-reports/item/patch-test.js | 8 +- .../monthly-reports/item/post-test.js | 8 +- .../monthly-reports/options-test.js | 6 +- .../integration/monthly-reports/patch-test.js | 6 +- .../integration/monthly-reports/post-test.js | 6 +- tests/integration/options-test.js | 6 +- tests/integration/patch-test.js | 6 +- tests/integration/post-test.js | 6 +- .../integration/subcategories/delete-test.js | 6 +- tests/integration/subcategories/get-test.js | 10 +- .../subcategories/item/delete-test.js | 10 +- .../subcategories/item/get-test.js | 8 +- .../subcategories/item/options-test.js | 8 +- .../subcategories/item/patch-test.js | 10 +- .../subcategories/item/post-test.js | 8 +- .../integration/subcategories/options-test.js | 6 +- tests/integration/subcategories/patch-test.js | 6 +- tests/integration/subcategories/post-test.js | 10 +- .../subcategory-annual-reports/delete-test.js | 6 +- .../subcategory-annual-reports/get-test.js | 12 +- .../item/delete-test.js | 8 +- .../item/get-test.js | 8 +- .../item/options-test.js | 8 +- .../item/patch-test.js | 8 +- .../item/post-test.js | 8 +- .../options-test.js | 6 +- .../subcategory-annual-reports/patch-test.js | 6 +- .../subcategory-annual-reports/post-test.js | 6 +- tests/integration/users/delete-test.js | 6 +- tests/integration/users/get-test.js | 8 +- tests/integration/users/item/delete-test.js | 8 +- tests/integration/users/item/get-test.js | 8 +- tests/integration/users/item/options-test.js | 8 +- tests/integration/users/item/patch-test.js | 10 +- tests/integration/users/item/post-test.js | 8 +- tests/integration/users/login/delete-test.js | 6 +- tests/integration/users/login/get-test.js | 6 +- tests/integration/users/login/options-test.js | 6 +- tests/integration/users/login/patch-test.js | 6 +- tests/integration/users/login/post-test.js | 12 +- .../users/login/token/delete-test.js | 6 +- .../integration/users/login/token/get-test.js | 6 +- .../users/login/token/options-test.js | 6 +- .../users/login/token/patch-test.js | 6 +- .../users/login/token/post-test.js | 12 +- tests/integration/users/options-test.js | 6 +- tests/integration/users/patch-test.js | 6 +- tests/integration/users/post-test.js | 12 +- tests/integration/vendors/delete-test.js | 6 +- tests/integration/vendors/get-test.js | 8 +- tests/integration/vendors/item/delete-test.js | 10 +- tests/integration/vendors/item/get-test.js | 8 +- .../integration/vendors/item/options-test.js | 8 +- tests/integration/vendors/item/patch-test.js | 10 +- tests/integration/vendors/item/post-test.js | 8 +- tests/integration/vendors/options-test.js | 6 +- tests/integration/vendors/patch-test.js | 6 +- tests/integration/vendors/post-test.js | 10 +- tests/sample-data/attachments.js | 2 +- tests/sample-data/budgets.js | 2 +- tests/sample-data/categories.js | 2 +- tests/sample-data/deposits.js | 2 +- tests/sample-data/employers.js | 2 +- tests/sample-data/expenses.js | 2 +- tests/sample-data/funds.js | 2 +- tests/sample-data/incomes.js | 2 +- tests/sample-data/index.js | 26 +- tests/sample-data/loan-payments.js | 2 +- tests/sample-data/loans.js | 2 +- tests/sample-data/users.js | 2 +- tests/sample-data/vendors.js | 2 +- tests/test-helper/index.js | 8 +- .../attachment-ctrl/create-attachment-test.js | 14 +- .../attachment-ctrl/delete-attachment-test.js | 16 +- .../attachment-ctrl/update-attachment-test.js | 16 +- .../attachment-ctrl/upload-attachment-test.js | 18 +- .../audit-ctrl/track-changes-test.js | 12 +- .../audit-ctrl/track-instance-destroy-test.js | 16 +- .../audit-ctrl/track-instance-update-test.js | 16 +- .../audit-ctrl/track-new-instance-test.js | 16 +- .../budget-ctrl/create-budget-test.js | 16 +- .../budget-ctrl/delete-budget-test.js | 14 +- .../budget-ctrl/update-budget-test.js | 14 +- .../category-ctrl/create-category-test.js | 16 +- .../category-ctrl/create-subcategory-test.js | 14 +- .../category-ctrl/delete-category-test.js | 14 +- .../category-ctrl/delete-subcategory-test.js | 16 +- .../category-ctrl/update-category-test.js | 14 +- .../category-ctrl/update-subcategory-test.js | 16 +- .../employer-ctrl/create-employer-test.js | 16 +- .../employer-ctrl/delete-employer-test.js | 14 +- .../employer-ctrl/update-employer-test.js | 14 +- .../expense-ctrl/create-expense-test.js | 14 +- .../expense-ctrl/delete-expense-test.js | 16 +- .../expense-ctrl/update-expense-test.js | 16 +- .../fund-ctrl/create-deposit-test.js | 14 +- .../controllers/fund-ctrl/create-fund-test.js | 16 +- .../fund-ctrl/delete-deposit-test.js | 14 +- .../controllers/fund-ctrl/delete-fund-test.js | 16 +- .../fund-ctrl/update-deposit-test.js | 16 +- .../controllers/fund-ctrl/update-fund-test.js | 14 +- .../household-ctrl/create-member-test.js | 16 +- .../household-ctrl/delete-member-test.js | 16 +- .../household-ctrl/update-member-test.js | 14 +- .../income-ctrl/create-income-test.js | 14 +- .../income-ctrl/delete-income-test.js | 14 +- .../income-ctrl/update-income-test.js | 16 +- .../loan-ctrl/create-loan-payment-test.js | 16 +- .../controllers/loan-ctrl/create-loan-test.js | 16 +- .../loan-ctrl/delete-loan-payment-test.js | 14 +- .../controllers/loan-ctrl/delete-loan-test.js | 16 +- .../loan-ctrl/update-loan-payment-test.js | 16 +- .../controllers/loan-ctrl/update-loan-test.js | 16 +- .../user-ctrl/add-user-to-household-test.js | 16 +- .../controllers/user-ctrl/get-token-test.js | 14 +- .../user-ctrl/login-with-password-test.js | 8 +- .../user-ctrl/login-with-token-test.js | 8 +- .../controllers/user-ctrl/sign-up-test.js | 16 +- .../user-ctrl/update-user-details-test.js | 16 +- .../vendor-ctrl/create-vendor-test.js | 16 +- .../vendor-ctrl/delete-vendor-test.js | 16 +- .../vendor-ctrl/update-vendor-test.js | 14 +- .../error-handler/audit-error-test.js | 4 +- .../error-handler/category-error-test.js | 4 +- .../error-handler/expense-error-test.js | 4 +- .../login-password-failed-error-test.js | 4 +- .../error-handler/user-error-test.js | 4 +- .../error-handler/vendor-error-test.js | 4 +- tests/unit/models/attachment-test.js | 4 +- tests/unit/models/audit/api-call-test.js | 4 +- tests/unit/models/audit/change-test.js | 4 +- tests/unit/models/audit/log-test.js | 4 +- tests/unit/models/budget-test.js | 4 +- tests/unit/models/category-test.js | 4 +- tests/unit/models/deposit-test.js | 4 +- tests/unit/models/employer-test.js | 4 +- tests/unit/models/expense-test.js | 4 +- tests/unit/models/fund-test.js | 4 +- tests/unit/models/hash-test.js | 4 +- tests/unit/models/household-member-test.js | 4 +- tests/unit/models/household-test.js | 4 +- tests/unit/models/income-test.js | 4 +- tests/unit/models/loan-payment-test.js | 4 +- tests/unit/models/loan-test.js | 4 +- tests/unit/models/subcategory-test.js | 4 +- tests/unit/models/user-login-test.js | 4 +- tests/unit/models/user-test.js | 4 +- tests/unit/models/vendor-test.js | 4 +- 542 files changed, 2391 insertions(+), 2058 deletions(-) diff --git a/app/controllers/attachment-ctrl/create-attachment.js b/app/controllers/attachment-ctrl/create-attachment.js index fe1287bb..fcfae46e 100644 --- a/app/controllers/attachment-ctrl/create-attachment.js +++ b/app/controllers/attachment-ctrl/create-attachment.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { AttachmentError } = require('../../middleware/error-handler'); +import { AttachmentError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ attachmentCtrl, auditApiCallUuid, expenseUuid, diff --git a/app/controllers/attachment-ctrl/delete-attachment.js b/app/controllers/attachment-ctrl/delete-attachment.js index 3fbd7a49..1ace166d 100644 --- a/app/controllers/attachment-ctrl/delete-attachment.js +++ b/app/controllers/attachment-ctrl/delete-attachment.js @@ -1,14 +1,14 @@ -const { DeleteObjectCommand } = require('@aws-sdk/client-s3'); -const Sequelize = require('sequelize'); +import { DeleteObjectCommand } from '@aws-sdk/client-s3'; +import Sequelize from 'sequelize'; -const { AttachmentError } = require('../../middleware/error-handler'); +import { AttachmentError } from '../../middleware/error-handler/index.js'; /** * @param {object} attachmentCtrl Instance of AttachmentCtrl * @param {string} attachmentUuid UUID of attachment to delete * @param {string} auditApiCallUuid */ -module.exports = async({ +export default async({ attachmentCtrl, attachmentUuid, auditApiCallUuid, diff --git a/app/controllers/attachment-ctrl/index.js b/app/controllers/attachment-ctrl/index.js index d772bfe0..24afaab8 100644 --- a/app/controllers/attachment-ctrl/index.js +++ b/app/controllers/attachment-ctrl/index.js @@ -1,12 +1,12 @@ -const { S3Client } = require('@aws-sdk/client-s3'); -const { getSignedUrl } = require('@aws-sdk/s3-request-presigner'); +import { S3Client } from '@aws-sdk/client-s3'; +import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; -const createAttachment = require('./create-attachment'); -const deleteAttachment = require('./delete-attachment'); -const updateAttachment = require('./update-attachment'); -const uploadAttachment = require('./upload-attachment'); +import createAttachment from './create-attachment.js'; +import deleteAttachment from './delete-attachment.js'; +import updateAttachment from './update-attachment.js'; +import uploadAttachment from './upload-attachment.js'; -class AttachmentCtrl { +export default class AttachmentCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -42,5 +42,3 @@ class AttachmentCtrl { }); } } - -module.exports = AttachmentCtrl; diff --git a/app/controllers/attachment-ctrl/update-attachment.js b/app/controllers/attachment-ctrl/update-attachment.js index 204b1ad2..4474d457 100644 --- a/app/controllers/attachment-ctrl/update-attachment.js +++ b/app/controllers/attachment-ctrl/update-attachment.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { AttachmentError } = require('../../middleware/error-handler'); +import { AttachmentError } from '../../middleware/error-handler/index.js'; /** * @param {object} attachmentCtrl Instance of AttachmentCtrl @@ -9,7 +9,7 @@ const { AttachmentError } = require('../../middleware/error-handler'); * @param {string} name * */ -module.exports = async({ +export default async({ attachmentCtrl, attachmentUuid, auditApiCallUuid, diff --git a/app/controllers/attachment-ctrl/upload-attachment.js b/app/controllers/attachment-ctrl/upload-attachment.js index 40307cb4..656066e4 100644 --- a/app/controllers/attachment-ctrl/upload-attachment.js +++ b/app/controllers/attachment-ctrl/upload-attachment.js @@ -1,13 +1,13 @@ -const { +import { CompleteMultipartUploadCommand, CreateMultipartUploadCommand, HeadObjectCommand, UploadPartCommand, -} = require('@aws-sdk/client-s3'); -const nconf = require('nconf'); -const Sequelize = require('sequelize'); +} from '@aws-sdk/client-s3'; +import nconf from 'nconf'; +import Sequelize from 'sequelize'; -const { AttachmentError } = require('../../middleware/error-handler'); +import { AttachmentError } from '../../middleware/error-handler/index.js'; /** * @param {object} attachmentCtrl Instance of AttachmentCtrl @@ -16,7 +16,7 @@ const { AttachmentError } = require('../../middleware/error-handler'); * @param {buffer} fileBody * @param {string} fileName */ -module.exports = async({ +export default async({ attachmentCtrl, attachmentUuid, auditApiCallUuid, diff --git a/app/controllers/audit-ctrl/index.js b/app/controllers/audit-ctrl/index.js index 04be9dfe..8d07af60 100644 --- a/app/controllers/audit-ctrl/index.js +++ b/app/controllers/audit-ctrl/index.js @@ -1,9 +1,9 @@ -const trackChanges = require('./track-changes'); -const trackInstanceDestroy = require('./track-instance-destroy'); -const trackInstanceUpdate = require('./track-instance-update'); -const trackNewInstance = require('./track-new-instance'); +import trackChanges from './track-changes.js'; +import trackInstanceDestroy from './track-instance-destroy.js'; +import trackInstanceUpdate from './track-instance-update.js'; +import trackNewInstance from './track-new-instance.js'; -class AuditCtrl { +export default class AuditCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -117,5 +117,3 @@ class AuditCtrl { }); } } - -module.exports = AuditCtrl; diff --git a/app/controllers/audit-ctrl/track-changes.js b/app/controllers/audit-ctrl/track-changes.js index 22b38127..8047e35d 100644 --- a/app/controllers/audit-ctrl/track-changes.js +++ b/app/controllers/audit-ctrl/track-changes.js @@ -1,4 +1,4 @@ -const { AuditError } = require('../../middleware/error-handler'); +import { AuditError } from '../../middleware/error-handler/index.js'; /** * Track the changes in the change list. The change list must be a list of @@ -13,7 +13,7 @@ const { AuditError } = require('../../middleware/error-handler'); * @param {object[]} [newList] List of Sequelize instances that have been created * @param {object} transaction Sequelize transaction */ -module.exports = async({ +export default async({ auditCtrl, auditApiCallUuid, changeList = [], diff --git a/app/controllers/audit-ctrl/track-instance-destroy.js b/app/controllers/audit-ctrl/track-instance-destroy.js index ae31dcfd..ec1e3ed1 100644 --- a/app/controllers/audit-ctrl/track-instance-destroy.js +++ b/app/controllers/audit-ctrl/track-instance-destroy.js @@ -1,4 +1,4 @@ -const { AuditError } = require('../../middleware/error-handler'); +import { AuditError } from '../../middleware/error-handler/index.js'; /** * Save audit change for deletion of paranoid instances. Only delete instances @@ -9,7 +9,7 @@ const { AuditError } = require('../../middleware/error-handler'); * @param {object} instance The Sequelize instance to track * @param {object} transaction Sequelize transaction */ -module.exports = async({ +export default async({ auditCtrl, auditLog, instance, diff --git a/app/controllers/audit-ctrl/track-instance-update.js b/app/controllers/audit-ctrl/track-instance-update.js index 5dc2a9e3..5ce5f25c 100644 --- a/app/controllers/audit-ctrl/track-instance-update.js +++ b/app/controllers/audit-ctrl/track-instance-update.js @@ -1,4 +1,4 @@ -const { AuditError } = require('../../middleware/error-handler'); +import { AuditError } from '../../middleware/error-handler/index.js'; /** * Save audit changes for the changed attributes for this instance using @@ -12,7 +12,7 @@ const { AuditError } = require('../../middleware/error-handler'); * @param {object} instance The Sequelize instance to track * @param {object} transaction Sequelize transaction */ -module.exports = async({ +export default async({ auditCtrl, auditLog, instance, diff --git a/app/controllers/audit-ctrl/track-new-instance.js b/app/controllers/audit-ctrl/track-new-instance.js index dbf122dd..e36e876d 100644 --- a/app/controllers/audit-ctrl/track-new-instance.js +++ b/app/controllers/audit-ctrl/track-new-instance.js @@ -1,4 +1,4 @@ -const { AuditError } = require('../../middleware/error-handler'); +import { AuditError } from '../../middleware/error-handler/index.js'; /** * Save audit changes for all attributes for this instance. Use @@ -11,7 +11,7 @@ const { AuditError } = require('../../middleware/error-handler'); * @param {object} instance The Sequelize instance to track * @param {object} transaction Sequelize transaction */ -module.exports = async({ +export default async({ auditCtrl, auditLog, instance, diff --git a/app/controllers/budget-ctrl/create-budget.js b/app/controllers/budget-ctrl/create-budget.js index 568e4afd..95b5d70e 100644 --- a/app/controllers/budget-ctrl/create-budget.js +++ b/app/controllers/budget-ctrl/create-budget.js @@ -1,9 +1,9 @@ -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { BudgetError } = require('../../middleware/error-handler'); +import { BudgetError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ amount, auditApiCallUuid, budgetCtrl, diff --git a/app/controllers/budget-ctrl/delete-budget.js b/app/controllers/budget-ctrl/delete-budget.js index 6f3eec6e..b1f25c46 100644 --- a/app/controllers/budget-ctrl/delete-budget.js +++ b/app/controllers/budget-ctrl/delete-budget.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { BudgetError } = require('../../middleware/error-handler'); +import { BudgetError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ auditApiCallUuid, budgetCtrl, budgetUuid, diff --git a/app/controllers/budget-ctrl/index.js b/app/controllers/budget-ctrl/index.js index 275df0d4..91acc23a 100644 --- a/app/controllers/budget-ctrl/index.js +++ b/app/controllers/budget-ctrl/index.js @@ -1,8 +1,8 @@ -const createBudget = require('./create-budget'); -const deleteBudget = require('./delete-budget'); -const updateBudget = require('./update-budget'); +import createBudget from './create-budget.js'; +import deleteBudget from './delete-budget.js'; +import updateBudget from './update-budget.js'; -class BudgetCtrl { +export default class BudgetCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -29,5 +29,3 @@ class BudgetCtrl { }); } } - -module.exports = BudgetCtrl; diff --git a/app/controllers/budget-ctrl/update-budget.js b/app/controllers/budget-ctrl/update-budget.js index 95396eaa..80868778 100644 --- a/app/controllers/budget-ctrl/update-budget.js +++ b/app/controllers/budget-ctrl/update-budget.js @@ -1,7 +1,7 @@ -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { BudgetError } = require('../../middleware/error-handler'); +import { BudgetError } from '../../middleware/error-handler/index.js'; const Op = Sequelize.Op; @@ -15,7 +15,7 @@ const Op = Sequelize.Op; * @param {string} subcategoryUuid * @param {integer} year */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, budgetCtrl, diff --git a/app/controllers/category-ctrl/create-category.js b/app/controllers/category-ctrl/create-category.js index 60eb40eb..3bc2e244 100644 --- a/app/controllers/category-ctrl/create-category.js +++ b/app/controllers/category-ctrl/create-category.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} categoryCtrl Instance of CategoryCtrl * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, name, diff --git a/app/controllers/category-ctrl/create-subcategory.js b/app/controllers/category-ctrl/create-subcategory.js index c63e1af7..327ca75e 100644 --- a/app/controllers/category-ctrl/create-subcategory.js +++ b/app/controllers/category-ctrl/create-subcategory.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { CategoryError } = require('../../middleware/error-handler'); * @param {string} categoryUuid * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, categoryUuid, diff --git a/app/controllers/category-ctrl/delete-category.js b/app/controllers/category-ctrl/delete-category.js index 222d9039..7f2b3dd9 100644 --- a/app/controllers/category-ctrl/delete-category.js +++ b/app/controllers/category-ctrl/delete-category.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} categoryCtrl Instance of CategoryCtrl * @param {string} categoryUuid UUID of the category to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, categoryUuid, diff --git a/app/controllers/category-ctrl/delete-subcategory.js b/app/controllers/category-ctrl/delete-subcategory.js index f9243baa..b81880a3 100644 --- a/app/controllers/category-ctrl/delete-subcategory.js +++ b/app/controllers/category-ctrl/delete-subcategory.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} categoryCtrl Instance of CategoryCtrl * @param {string} subcategoryUuid UUID of the subcategory to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, subcategoryUuid, diff --git a/app/controllers/category-ctrl/index.js b/app/controllers/category-ctrl/index.js index d2a3dcb6..c4c9f9a3 100644 --- a/app/controllers/category-ctrl/index.js +++ b/app/controllers/category-ctrl/index.js @@ -1,11 +1,11 @@ -const createCategory = require('./create-category'); -const createSubcategory = require('./create-subcategory'); -const deleteCategory = require('./delete-category'); -const deleteSubcategory = require('./delete-subcategory'); -const updateCategory = require('./update-category'); -const updateSubcategory = require('./update-subcategory'); +import createCategory from './create-category.js'; +import createSubcategory from './create-subcategory.js'; +import deleteCategory from './delete-category.js'; +import deleteSubcategory from './delete-subcategory.js'; +import updateCategory from './update-category.js'; +import updateSubcategory from './update-subcategory.js'; -class CategoryCtrl { +export default class CategoryCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -85,5 +85,3 @@ class CategoryCtrl { }); } } - -module.exports = CategoryCtrl; diff --git a/app/controllers/category-ctrl/update-category.js b/app/controllers/category-ctrl/update-category.js index e66f4555..5d09965f 100644 --- a/app/controllers/category-ctrl/update-category.js +++ b/app/controllers/category-ctrl/update-category.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { CategoryError } = require('../../middleware/error-handler'); * @param {string} categoryUuid UUID of the category to update * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, categoryUuid, diff --git a/app/controllers/category-ctrl/update-subcategory.js b/app/controllers/category-ctrl/update-subcategory.js index 62e432be..f9cdb653 100644 --- a/app/controllers/category-ctrl/update-subcategory.js +++ b/app/controllers/category-ctrl/update-subcategory.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -9,7 +9,7 @@ const { CategoryError } = require('../../middleware/error-handler'); * @param {string} name * @param {string} subcategoryUuid */ -module.exports = async({ +export default async({ auditApiCallUuid, categoryCtrl, categoryUuid, diff --git a/app/controllers/employer-ctrl/create-employer.js b/app/controllers/employer-ctrl/create-employer.js index 8274c31e..7d4c185f 100644 --- a/app/controllers/employer-ctrl/create-employer.js +++ b/app/controllers/employer-ctrl/create-employer.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { EmployerError } = require('../../middleware/error-handler'); +import { EmployerError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ auditApiCallUuid, employerCtrl, name, diff --git a/app/controllers/employer-ctrl/delete-employer.js b/app/controllers/employer-ctrl/delete-employer.js index 9fa908cc..05485d9e 100644 --- a/app/controllers/employer-ctrl/delete-employer.js +++ b/app/controllers/employer-ctrl/delete-employer.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { EmployerError } = require('../../middleware/error-handler'); +import { EmployerError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} employerCtrl Instance of EmployerCtrl * @param {string} employerUuid UUID of the employer to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, employerCtrl, employerUuid, diff --git a/app/controllers/employer-ctrl/index.js b/app/controllers/employer-ctrl/index.js index b7cc2634..fa93146e 100644 --- a/app/controllers/employer-ctrl/index.js +++ b/app/controllers/employer-ctrl/index.js @@ -1,8 +1,8 @@ -const createEmployer = require('./create-employer'); -const deleteEmployer = require('./delete-employer'); -const updateEmployer = require('./update-employer'); +import createEmployer from './create-employer.js'; +import deleteEmployer from './delete-employer.js'; +import updateEmployer from './update-employer.js'; -class EmployerCtrl { +export default class EmployerCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -43,5 +43,3 @@ class EmployerCtrl { }); } } - -module.exports = EmployerCtrl; diff --git a/app/controllers/employer-ctrl/update-employer.js b/app/controllers/employer-ctrl/update-employer.js index 9d368501..a77d00ae 100644 --- a/app/controllers/employer-ctrl/update-employer.js +++ b/app/controllers/employer-ctrl/update-employer.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { EmployerError } = require('../../middleware/error-handler'); +import { EmployerError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { EmployerError } = require('../../middleware/error-handler'); * @param {string} employerUuid * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, employerCtrl, employerUuid, diff --git a/app/controllers/expense-ctrl/create-expense.js b/app/controllers/expense-ctrl/create-expense.js index 8f0550d8..65f820f4 100644 --- a/app/controllers/expense-ctrl/create-expense.js +++ b/app/controllers/expense-ctrl/create-expense.js @@ -1,8 +1,8 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import moment from 'moment'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { ExpenseError } = require('../../middleware/error-handler'); +import { ExpenseError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -16,7 +16,7 @@ const { ExpenseError } = require('../../middleware/error-handler'); * @param {string} subcategoryUuid * @param {string} vendorUuid */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/expense-ctrl/delete-expense.js b/app/controllers/expense-ctrl/delete-expense.js index 1a7279de..6afe59d2 100644 --- a/app/controllers/expense-ctrl/delete-expense.js +++ b/app/controllers/expense-ctrl/delete-expense.js @@ -1,14 +1,14 @@ -const { DeleteObjectCommand } = require('@aws-sdk/client-s3'); -const Sequelize = require('sequelize'); +import { DeleteObjectCommand } from '@aws-sdk/client-s3'; +import Sequelize from 'sequelize'; -const { ExpenseError } = require('../../middleware/error-handler'); +import { ExpenseError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} expenseCtrl Instance of ExpenseCtrl * @param {string} expenseUuid UUID of the expense to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, expenseCtrl, expenseUuid, diff --git a/app/controllers/expense-ctrl/index.js b/app/controllers/expense-ctrl/index.js index cabf8848..b717c6c7 100644 --- a/app/controllers/expense-ctrl/index.js +++ b/app/controllers/expense-ctrl/index.js @@ -1,8 +1,8 @@ -const createExpense = require('./create-expense'); -const deleteExpense = require('./delete-expense'); -const updateExpense = require('./update-expense'); +import createExpense from './create-expense.js'; +import deleteExpense from './delete-expense.js'; +import updateExpense from './update-expense.js'; -class ExpenseCtrl { +export default class ExpenseCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -29,5 +29,3 @@ class ExpenseCtrl { }); } } - -module.exports = ExpenseCtrl; diff --git a/app/controllers/expense-ctrl/update-expense.js b/app/controllers/expense-ctrl/update-expense.js index c8721e45..899d2c1b 100644 --- a/app/controllers/expense-ctrl/update-expense.js +++ b/app/controllers/expense-ctrl/update-expense.js @@ -1,8 +1,8 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import moment from 'moment'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { ExpenseError } = require('../../middleware/error-handler'); +import { ExpenseError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -17,7 +17,7 @@ const { ExpenseError } = require('../../middleware/error-handler'); * @param {string} subcategoryUuid * @param {string} vendorUuid */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/fund-ctrl/create-deposit.js b/app/controllers/fund-ctrl/create-deposit.js index 903e0321..c035f5dc 100644 --- a/app/controllers/fund-ctrl/create-deposit.js +++ b/app/controllers/fund-ctrl/create-deposit.js @@ -1,7 +1,7 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -10,7 +10,7 @@ const { FundError } = require('../../middleware/error-handler'); * @param {object} fundCtrl Instance of FundCtrl * @param {string} fundUuid */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/fund-ctrl/create-fund.js b/app/controllers/fund-ctrl/create-fund.js index 4d251008..42a73078 100644 --- a/app/controllers/fund-ctrl/create-fund.js +++ b/app/controllers/fund-ctrl/create-fund.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} fundCtrl Instance of FundCtrl * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, fundCtrl, name, diff --git a/app/controllers/fund-ctrl/delete-deposit.js b/app/controllers/fund-ctrl/delete-deposit.js index ad6629e0..50930c0f 100644 --- a/app/controllers/fund-ctrl/delete-deposit.js +++ b/app/controllers/fund-ctrl/delete-deposit.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {string} depositUuid UUID of the deposit to delete * @param {object} fundCtrl Instance of FundCtrl */ -module.exports = async({ +export default async({ auditApiCallUuid, depositUuid, fundCtrl, diff --git a/app/controllers/fund-ctrl/delete-fund.js b/app/controllers/fund-ctrl/delete-fund.js index 25e4527e..d9b1fce0 100644 --- a/app/controllers/fund-ctrl/delete-fund.js +++ b/app/controllers/fund-ctrl/delete-fund.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} fundCtrl Instance of FundCtrl * @param {string} fundUuid UUID of the fund to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, fundCtrl, fundUuid, diff --git a/app/controllers/fund-ctrl/index.js b/app/controllers/fund-ctrl/index.js index b42ff07e..6479968d 100644 --- a/app/controllers/fund-ctrl/index.js +++ b/app/controllers/fund-ctrl/index.js @@ -1,11 +1,11 @@ -const createDeposit = require('./create-deposit'); -const createFund = require('./create-fund'); -const deleteDeposit = require('./delete-deposit'); -const deleteFund = require('./delete-fund'); -const updateDeposit = require('./update-deposit'); -const updateFund = require('./update-fund'); - -class FundCtrl { +import createDeposit from './create-deposit.js'; +import createFund from './create-fund.js'; +import deleteDeposit from './delete-deposit.js'; +import deleteFund from './delete-fund.js'; +import updateDeposit from './update-deposit.js'; +import updateFund from './update-fund.js'; + +export default class FundCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -53,5 +53,3 @@ class FundCtrl { }); } } - -module.exports = FundCtrl; diff --git a/app/controllers/fund-ctrl/update-deposit.js b/app/controllers/fund-ctrl/update-deposit.js index 7b90a2f3..d6ccda29 100644 --- a/app/controllers/fund-ctrl/update-deposit.js +++ b/app/controllers/fund-ctrl/update-deposit.js @@ -1,7 +1,7 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -11,7 +11,7 @@ const { FundError } = require('../../middleware/error-handler'); * @param {object} fundCtrl Instance of FundCtrl * @param {string} fundUuid */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/fund-ctrl/update-fund.js b/app/controllers/fund-ctrl/update-fund.js index dcaa975e..c5b6199c 100644 --- a/app/controllers/fund-ctrl/update-fund.js +++ b/app/controllers/fund-ctrl/update-fund.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { FundError } = require('../../middleware/error-handler'); * @param {string} fundUuid UUID of the fund to update * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, fundCtrl, fundUuid, diff --git a/app/controllers/household-ctrl/create-member.js b/app/controllers/household-ctrl/create-member.js index a829c550..f95980de 100644 --- a/app/controllers/household-ctrl/create-member.js +++ b/app/controllers/household-ctrl/create-member.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { HouseholdError } = require('../../middleware/error-handler'); +import { HouseholdError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {string} name * @param {object} vendorCtrl Instance of VendorCtrl */ -module.exports = async({ +export default async({ auditApiCallUuid, name, householdCtrl, diff --git a/app/controllers/household-ctrl/delete-member.js b/app/controllers/household-ctrl/delete-member.js index d6d0307d..962f3799 100644 --- a/app/controllers/household-ctrl/delete-member.js +++ b/app/controllers/household-ctrl/delete-member.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { HouseholdError } = require('../../middleware/error-handler'); +import { HouseholdError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} householdCtrl Instance of HouseholdCtrl * @param {string} householdMemberUuid UUID of the household member to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, householdCtrl, householdMemberUuid, diff --git a/app/controllers/household-ctrl/index.js b/app/controllers/household-ctrl/index.js index 30cd0f1f..3fbe2953 100644 --- a/app/controllers/household-ctrl/index.js +++ b/app/controllers/household-ctrl/index.js @@ -1,8 +1,8 @@ -const createMember = require('./create-member'); -const deleteMember = require('./delete-member'); -const updateMember = require('./update-member'); +import createMember from './create-member.js'; +import deleteMember from './delete-member.js'; +import updateMember from './update-member.js'; -class HouseholdCtrl { +export default class HouseholdCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -43,5 +43,3 @@ class HouseholdCtrl { }); } } - -module.exports = HouseholdCtrl; diff --git a/app/controllers/household-ctrl/update-member.js b/app/controllers/household-ctrl/update-member.js index 25e7e031..fe134a24 100644 --- a/app/controllers/household-ctrl/update-member.js +++ b/app/controllers/household-ctrl/update-member.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { HouseholdError } = require('../../middleware/error-handler'); +import { HouseholdError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { HouseholdError } = require('../../middleware/error-handler'); * @param {string} householdMemberUuid * @param {string} name */ -module.exports = async({ +export default async({ auditApiCallUuid, householdCtrl, householdMemberUuid, diff --git a/app/controllers/income-ctrl/create-income.js b/app/controllers/income-ctrl/create-income.js index 42d09b99..d7fae765 100644 --- a/app/controllers/income-ctrl/create-income.js +++ b/app/controllers/income-ctrl/create-income.js @@ -1,8 +1,8 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import moment from 'moment'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { IncomeError } = require('../../middleware/error-handler'); +import { IncomeError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -13,7 +13,7 @@ const { IncomeError } = require('../../middleware/error-handler'); * @param {string} householdMemberUuid * @param {object} incomeCtrl Instance of IncomeCtrl */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/income-ctrl/delete-income.js b/app/controllers/income-ctrl/delete-income.js index 26f8961b..ecf676e6 100644 --- a/app/controllers/income-ctrl/delete-income.js +++ b/app/controllers/income-ctrl/delete-income.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { IncomeError } = require('../../middleware/error-handler'); +import { IncomeError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} incomeCtrl Instance of IncomeCtrl * @param {string} incomeUuid UUID of the income to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, incomeCtrl, incomeUuid, diff --git a/app/controllers/income-ctrl/index.js b/app/controllers/income-ctrl/index.js index 8a3397b9..b32aed09 100644 --- a/app/controllers/income-ctrl/index.js +++ b/app/controllers/income-ctrl/index.js @@ -1,8 +1,8 @@ -const createIncome = require('./create-income'); -const deleteIncome = require('./delete-income'); -const updateIncome = require('./update-income'); +import createIncome from './create-income.js'; +import deleteIncome from './delete-income.js'; +import updateIncome from './update-income.js'; -class IncomeCtrl { +export default class IncomeCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -59,5 +59,3 @@ class IncomeCtrl { }); } } - -module.exports = IncomeCtrl; diff --git a/app/controllers/income-ctrl/update-income.js b/app/controllers/income-ctrl/update-income.js index a70d69e9..a534f404 100644 --- a/app/controllers/income-ctrl/update-income.js +++ b/app/controllers/income-ctrl/update-income.js @@ -1,8 +1,8 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import moment from 'moment'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { IncomeError } = require('../../middleware/error-handler'); +import{ IncomeError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -14,7 +14,7 @@ const { IncomeError } = require('../../middleware/error-handler'); * @param {object} incomeCtrl Instance of IncomeCtrl * @param {string} incomeUuid */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, date, diff --git a/app/controllers/index.js b/app/controllers/index.js index 94a701c5..e8de4a11 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -1,17 +1,17 @@ -const AttachmentCtrl = require('./attachment-ctrl'); -const AuditCtrl = require('./audit-ctrl'); -const BudgetCtrl = require('./budget-ctrl'); -const CategoryCtrl = require('./category-ctrl'); -const EmployerCtrl = require('./employer-ctrl'); -const ExpenseCtrl = require('./expense-ctrl'); -const FundCtrl = require('./fund-ctrl'); -const HouseholdCtrl = require('./household-ctrl'); -const IncomeCtrl = require('./income-ctrl'); -const LoanCtrl = require('./loan-ctrl'); -const UserCtrl = require('./user-ctrl'); -const VendorCtrl = require('./vendor-ctrl'); +import AttachmentCtrl from './attachment-ctrl/index.js'; +import AuditCtrl from './audit-ctrl/index.js'; +import BudgetCtrl from './budget-ctrl/index.js'; +import CategoryCtrl from './category-ctrl/index.js'; +import EmployerCtrl from './employer-ctrl/index.js'; +import ExpenseCtrl from './expense-ctrl/index.js'; +import FundCtrl from './fund-ctrl/index.js'; +import HouseholdCtrl from './household-ctrl/index.js'; +import IncomeCtrl from './income-ctrl/index.js'; +import LoanCtrl from './loan-ctrl/index.js'; +import UserCtrl from './user-ctrl/index.js'; +import VendorCtrl from './vendor-ctrl/index.js'; -class Controllers { +export default class Controllers { constructor(models) { this.models = models; @@ -29,5 +29,3 @@ class Controllers { this.VendorCtrl = new VendorCtrl(this, models); } } - -module.exports = Controllers; diff --git a/app/controllers/loan-ctrl/create-loan-payment.js b/app/controllers/loan-ctrl/create-loan-payment.js index dc9cc849..9d5cd3ed 100644 --- a/app/controllers/loan-ctrl/create-loan-payment.js +++ b/app/controllers/loan-ctrl/create-loan-payment.js @@ -1,7 +1,7 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -11,7 +11,7 @@ const { LoanError } = require('../../middleware/error-handler'); * @param {string} loanUuid * @param {integer} principalAmount */ -module.exports = async({ +export default async({ auditApiCallUuid, date, interestAmount, diff --git a/app/controllers/loan-ctrl/create-loan.js b/app/controllers/loan-ctrl/create-loan.js index f65694a0..36085843 100644 --- a/app/controllers/loan-ctrl/create-loan.js +++ b/app/controllers/loan-ctrl/create-loan.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -8,7 +8,7 @@ const { LoanError } = require('../../middleware/error-handler'); * @param {object} loanCtrl * @param {string} name */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, loanCtrl, diff --git a/app/controllers/loan-ctrl/delete-loan-payment.js b/app/controllers/loan-ctrl/delete-loan-payment.js index cf2eab6b..9ca10230 100644 --- a/app/controllers/loan-ctrl/delete-loan-payment.js +++ b/app/controllers/loan-ctrl/delete-loan-payment.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} loanCtrl Instance of LoanCtrl * @param {string} loanPaymentUuid UUID of the loan payment to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, loanCtrl, loanPaymentUuid, diff --git a/app/controllers/loan-ctrl/delete-loan.js b/app/controllers/loan-ctrl/delete-loan.js index 000f85b0..82ccd94d 100644 --- a/app/controllers/loan-ctrl/delete-loan.js +++ b/app/controllers/loan-ctrl/delete-loan.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} loanCtrl Instance of LoanCtrl * @param {string} loanUuid UUID of the loan to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, loanCtrl, loanUuid, diff --git a/app/controllers/loan-ctrl/index.js b/app/controllers/loan-ctrl/index.js index 70e1e6fc..a83aff3c 100644 --- a/app/controllers/loan-ctrl/index.js +++ b/app/controllers/loan-ctrl/index.js @@ -1,11 +1,11 @@ -const createLoan = require('./create-loan'); -const createLoanPayment = require('./create-loan-payment'); -const deleteLoan = require('./delete-loan'); -const deleteLoanPayment = require('./delete-loan-payment'); -const updateLoan = require('./update-loan'); -const updateLoanPayment = require('./update-loan-payment'); - -class LoanCtrl { +import createLoan from './create-loan.js'; +import createLoanPayment from './create-loan-payment.js'; +import deleteLoan from './delete-loan.js'; +import deleteLoanPayment from './delete-loan-payment.js'; +import updateLoan from './update-loan.js'; +import updateLoanPayment from './update-loan-payment.js'; + +export default class LoanCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -53,5 +53,3 @@ class LoanCtrl { }); } } - -module.exports = LoanCtrl; diff --git a/app/controllers/loan-ctrl/update-loan-payment.js b/app/controllers/loan-ctrl/update-loan-payment.js index ea680d27..3daab713 100644 --- a/app/controllers/loan-ctrl/update-loan-payment.js +++ b/app/controllers/loan-ctrl/update-loan-payment.js @@ -1,7 +1,7 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -12,7 +12,7 @@ const { LoanError } = require('../../middleware/error-handler'); * @param {string} loanUuid * @param {integer} principalAmount */ -module.exports = async({ +export default async({ auditApiCallUuid, date, interestAmount, diff --git a/app/controllers/loan-ctrl/update-loan.js b/app/controllers/loan-ctrl/update-loan.js index d9a74d9b..640d5eaf 100644 --- a/app/controllers/loan-ctrl/update-loan.js +++ b/app/controllers/loan-ctrl/update-loan.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; /** * @param {integer} amount @@ -9,7 +9,7 @@ const { LoanError } = require('../../middleware/error-handler'); * @param {string} loanUuid UUID of the loan to update * @param {string} name */ -module.exports = async({ +export default async({ amount, auditApiCallUuid, loanCtrl, diff --git a/app/controllers/user-ctrl/add-user-to-household.js b/app/controllers/user-ctrl/add-user-to-household.js index b7c2aef8..18719ba6 100644 --- a/app/controllers/user-ctrl/add-user-to-household.js +++ b/app/controllers/user-ctrl/add-user-to-household.js @@ -1,10 +1,10 @@ -const crypto = require('crypto'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import crypto from 'crypto'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { UserError } = require('../../middleware/error-handler'); +import { UserError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ auditApiCallUuid, email, firstName, diff --git a/app/controllers/user-ctrl/get-token.js b/app/controllers/user-ctrl/get-token.js index 113fb55b..d8b233b7 100644 --- a/app/controllers/user-ctrl/get-token.js +++ b/app/controllers/user-ctrl/get-token.js @@ -1,9 +1,9 @@ -const jwt = require('jsonwebtoken'); -const nconf = require('nconf'); +import jwt from 'jsonwebtoken'; +import nconf from 'nconf'; -const { UserError } = require('../../middleware/error-handler'); +import { UserError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ userCtrl, userUuid, }) => { diff --git a/app/controllers/user-ctrl/index.js b/app/controllers/user-ctrl/index.js index 67f565f8..c303a719 100644 --- a/app/controllers/user-ctrl/index.js +++ b/app/controllers/user-ctrl/index.js @@ -1,11 +1,11 @@ -const addUserToHousehold = require('./add-user-to-household'); -const getToken = require('./get-token'); -const loginWithPassword = require('./login-with-password'); -const loginWithToken = require('./login-with-token'); -const signUp = require('./sign-up'); -const updateUserDetails = require('./update-user-details'); +import addUserToHousehold from './add-user-to-household.js'; +import getToken from './get-token.js'; +import loginWithPassword from './login-with-password.js'; +import loginWithToken from './login-with-token.js'; +import signUp from './sign-up.js'; +import updateUserDetails from './update-user-details.js'; -class UserCtrl { +export default class UserCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -81,5 +81,3 @@ class UserCtrl { }); } } - -module.exports = UserCtrl; diff --git a/app/controllers/user-ctrl/login-with-password.js b/app/controllers/user-ctrl/login-with-password.js index 233749d4..5cccd617 100644 --- a/app/controllers/user-ctrl/login-with-password.js +++ b/app/controllers/user-ctrl/login-with-password.js @@ -1,8 +1,8 @@ -const crypto = require('crypto'); +import crypto from 'crypto'; -const { LoginPasswordFailedError } = require('../../middleware/error-handler'); +import { LoginPasswordFailedError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ email, password, userCtrl, diff --git a/app/controllers/user-ctrl/login-with-token.js b/app/controllers/user-ctrl/login-with-token.js index 95b44843..7a5e5be3 100644 --- a/app/controllers/user-ctrl/login-with-token.js +++ b/app/controllers/user-ctrl/login-with-token.js @@ -1,7 +1,7 @@ -const jwt = require('jsonwebtoken'); -const nconf = require('nconf'); +import jwt from 'jsonwebtoken'; +import nconf from 'nconf'; -module.exports = async({ +export default async({ token, userCtrl, }) => { diff --git a/app/controllers/user-ctrl/sign-up.js b/app/controllers/user-ctrl/sign-up.js index 1186cfaa..54d7709f 100644 --- a/app/controllers/user-ctrl/sign-up.js +++ b/app/controllers/user-ctrl/sign-up.js @@ -1,8 +1,8 @@ -const crypto = require('crypto'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import crypto from 'crypto'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { UserError } = require('../../middleware/error-handler'); +import { UserError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -12,7 +12,7 @@ const { UserError } = require('../../middleware/error-handler'); * @param {string} password * @param {object} userCtrl Instance of UserCtrl */ -module.exports = async({ +export default async({ auditApiCallUuid, email, firstName, diff --git a/app/controllers/user-ctrl/update-user-details.js b/app/controllers/user-ctrl/update-user-details.js index 26282db8..e88e1e66 100644 --- a/app/controllers/user-ctrl/update-user-details.js +++ b/app/controllers/user-ctrl/update-user-details.js @@ -1,9 +1,9 @@ -const Sequelize = require('sequelize'); -const _ = require('lodash'); +import Sequelize from 'sequelize'; +import _ from 'lodash'; -const { UserError } = require('../../middleware/error-handler'); +import { UserError } from '../../middleware/error-handler/index.js'; -module.exports = async({ +export default async({ auditApiCallUuid, email, firstName, diff --git a/app/controllers/vendor-ctrl/create-vendor.js b/app/controllers/vendor-ctrl/create-vendor.js index 471bf4a6..33f3a81c 100644 --- a/app/controllers/vendor-ctrl/create-vendor.js +++ b/app/controllers/vendor-ctrl/create-vendor.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { VendorError } = require('../../middleware/error-handler'); +import { VendorError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {string} name * @param {object} vendorCtrl Instance of VendorCtrl */ -module.exports = async({ +export default async({ auditApiCallUuid, name, vendorCtrl, diff --git a/app/controllers/vendor-ctrl/delete-vendor.js b/app/controllers/vendor-ctrl/delete-vendor.js index b0d4d926..4d8ace00 100644 --- a/app/controllers/vendor-ctrl/delete-vendor.js +++ b/app/controllers/vendor-ctrl/delete-vendor.js @@ -1,13 +1,13 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { VendorError } = require('../../middleware/error-handler'); +import { VendorError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid * @param {object} vendorCtrl Instance of VendorCtrl * @param {string} vendorUuid UUID of the vendor to delete */ -module.exports = async({ +export default async({ auditApiCallUuid, vendorCtrl, vendorUuid, diff --git a/app/controllers/vendor-ctrl/index.js b/app/controllers/vendor-ctrl/index.js index 223816a9..56520db4 100644 --- a/app/controllers/vendor-ctrl/index.js +++ b/app/controllers/vendor-ctrl/index.js @@ -1,8 +1,8 @@ -const createVendor = require('./create-vendor'); -const deleteVendor = require('./delete-vendor'); -const updateVendor = require('./update-vendor'); +import createVendor from './create-vendor.js'; +import deleteVendor from './delete-vendor.js'; +import updateVendor from './update-vendor.js'; -class VendorCtrl { +export default class VendorCtrl { constructor(parent, models) { this.parent = parent; this.models = models; @@ -43,5 +43,3 @@ class VendorCtrl { }); } } - -module.exports = VendorCtrl; diff --git a/app/controllers/vendor-ctrl/update-vendor.js b/app/controllers/vendor-ctrl/update-vendor.js index 14eb5e0d..d12a5c72 100644 --- a/app/controllers/vendor-ctrl/update-vendor.js +++ b/app/controllers/vendor-ctrl/update-vendor.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { VendorError } = require('../../middleware/error-handler'); +import { VendorError } from '../../middleware/error-handler/index.js'; /** * @param {string} auditApiCallUuid @@ -8,7 +8,7 @@ const { VendorError } = require('../../middleware/error-handler'); * @param {object} vendorCtrl * @param {string} vendorUuid */ -module.exports = async({ +export default async({ auditApiCallUuid, name, vendorCtrl, diff --git a/app/index.js b/app/index.js index f3b7b8f1..8815bbc9 100644 --- a/app/index.js +++ b/app/index.js @@ -1,24 +1,29 @@ -const bodyParser = require('body-parser'); -const cookieParser = require('cookie-parser'); -const express = require('express'); -const nconf = require('nconf'); -const { Umzug, SequelizeStorage } = require('umzug'); +import bodyParser from 'body-parser'; +import cookieParser from 'cookie-parser'; +import express from 'express'; +import nconf from 'nconf'; +import { Umzug, SequelizeStorage } from 'umzug'; -const Controllers = require('./controllers'); -const Middleware = require('./middleware'); -const Models = require('./models'); -const routes = require('./routes'); +import Controllers from './controllers/index.js'; +import { + Auditor, + Authentication, + ErrorHandlerMiddleware, + Validator, +} from './middleware/index.js'; +import Models from './models/index.js'; +import routes from './routes/index.js'; -class App { +export default class App { constructor({ logger }) { this.app = express(); this.app.set('logger', logger); this.app.set('models', new Models(nconf.get('DATABASE_URL'))); this.app.set('controllers', new Controllers(this.app.get('models'))); - this.app.set('Auditor', new Middleware.Auditor(this.app.get('models'))); - const Authentication = Middleware.Authentication(logger); - this.app.set('Authentication', Authentication); - this.app.set('Validator', Middleware.Validator); + this.app.set('Auditor', new Auditor(this.app.get('models'))); + const auth = Authentication(logger); + this.app.set('Authentication', auth); + this.app.set('Validator', new Validator()); this.app.use(bodyParser.urlencoded({ extended: true, @@ -42,11 +47,11 @@ class App { return next(); }); - this.app.use(Authentication.checkBearerAuth); + this.app.use(auth.checkBearerAuth); routes(this.app); - this.app.use(Middleware.ErrorHandler.middleware); + this.app.use(ErrorHandlerMiddleware); this.app.use((err, req, res, next) => { if (err) { @@ -84,5 +89,3 @@ class App { }); } } - -module.exports = App; diff --git a/app/middleware/auditor/index.js b/app/middleware/auditor/index.js index ebdcb338..5bfc2e88 100644 --- a/app/middleware/auditor/index.js +++ b/app/middleware/auditor/index.js @@ -1,4 +1,4 @@ -class Auditor { +export default class Auditor { constructor(models) { this.models = models; } @@ -21,5 +21,3 @@ class Auditor { }; } } - -module.exports = Auditor; diff --git a/app/middleware/authentication/index.js b/app/middleware/authentication/index.js index 2597c334..b87eef18 100644 --- a/app/middleware/authentication/index.js +++ b/app/middleware/authentication/index.js @@ -1,8 +1,8 @@ -const ConnectRoles = require('connect-roles'); -const jwt = require('jsonwebtoken'); -const nconf = require('nconf'); +import ConnectRoles from 'connect-roles'; +import jwt from 'jsonwebtoken'; +import nconf from 'nconf'; -module.exports = (logger) => { +export default (logger) => { const Authentication = { checkBearerAuth(req, res, next) { req.userUuid = null; diff --git a/app/middleware/error-handler/attachment-error.js b/app/middleware/error-handler/attachment-error.js index 3d14caed..752161e1 100644 --- a/app/middleware/error-handler/attachment-error.js +++ b/app/middleware/error-handler/attachment-error.js @@ -1,4 +1,4 @@ -module.exports = class AttachmentError extends Error { +export class AttachmentError extends Error { constructor(message) { super(message); this.name = 'AttachmentError'; diff --git a/app/middleware/error-handler/audit-error.js b/app/middleware/error-handler/audit-error.js index ab2ad3b5..578ff9b4 100644 --- a/app/middleware/error-handler/audit-error.js +++ b/app/middleware/error-handler/audit-error.js @@ -1,4 +1,4 @@ -module.exports = class AuditError extends Error { +export class AuditError extends Error { constructor(message) { super(message); this.name = 'AuditError'; diff --git a/app/middleware/error-handler/budget-error.js b/app/middleware/error-handler/budget-error.js index af86e0d1..1fadfc4c 100644 --- a/app/middleware/error-handler/budget-error.js +++ b/app/middleware/error-handler/budget-error.js @@ -1,4 +1,4 @@ -module.exports = class BudgetError extends Error { +export class BudgetError extends Error { constructor(message) { super(message); this.name = 'BudgetError'; diff --git a/app/middleware/error-handler/category-error.js b/app/middleware/error-handler/category-error.js index 166adb13..23807e0c 100644 --- a/app/middleware/error-handler/category-error.js +++ b/app/middleware/error-handler/category-error.js @@ -1,4 +1,4 @@ -module.exports = class CategoryError extends Error { +export class CategoryError extends Error { constructor(message) { super(message); this.name = 'CategoryError'; diff --git a/app/middleware/error-handler/employer-error.js b/app/middleware/error-handler/employer-error.js index 863a00a7..8eb2e462 100644 --- a/app/middleware/error-handler/employer-error.js +++ b/app/middleware/error-handler/employer-error.js @@ -1,4 +1,4 @@ -module.exports = class EmployerError extends Error { +export class EmployerError extends Error { constructor(message) { super(message); this.name = 'EmployerError'; diff --git a/app/middleware/error-handler/expense-error.js b/app/middleware/error-handler/expense-error.js index 742dc43a..1e7f08da 100644 --- a/app/middleware/error-handler/expense-error.js +++ b/app/middleware/error-handler/expense-error.js @@ -1,4 +1,4 @@ -module.exports = class ExpenseError extends Error { +export class ExpenseError extends Error { constructor(message) { super(message); this.name = 'ExpenseError'; diff --git a/app/middleware/error-handler/fund-error.js b/app/middleware/error-handler/fund-error.js index ef3677d0..d5d6cd44 100644 --- a/app/middleware/error-handler/fund-error.js +++ b/app/middleware/error-handler/fund-error.js @@ -1,4 +1,4 @@ -module.exports = class FundError extends Error { +export class FundError extends Error { constructor(message) { super(message); this.name = 'FundError'; diff --git a/app/middleware/error-handler/household-error.js b/app/middleware/error-handler/household-error.js index 9129be51..be5be1ec 100644 --- a/app/middleware/error-handler/household-error.js +++ b/app/middleware/error-handler/household-error.js @@ -1,4 +1,4 @@ -module.exports = class HouseholdError extends Error { +export class HouseholdError extends Error { constructor(message) { super(message); this.name = 'HouseholdError'; diff --git a/app/middleware/error-handler/income-error.js b/app/middleware/error-handler/income-error.js index 354a3e79..09d1549d 100644 --- a/app/middleware/error-handler/income-error.js +++ b/app/middleware/error-handler/income-error.js @@ -1,4 +1,4 @@ -module.exports = class IncomeError extends Error { +export class IncomeError extends Error { constructor(message) { super(message); this.name = 'IncomeError'; diff --git a/app/middleware/error-handler/index.js b/app/middleware/error-handler/index.js index 6f5065e7..f48428bf 100644 --- a/app/middleware/error-handler/index.js +++ b/app/middleware/error-handler/index.js @@ -1,16 +1,387 @@ -const AttachmentError = require('./attachment-error'); -const AuditError = require('./audit-error'); -const BudgetError = require('./budget-error'); -const CategoryError = require('./category-error'); -const EmployerError = require('./employer-error'); -const ExpenseError = require('./expense-error'); -const FundError = require('./fund-error'); -const HouseholdError = require('./household-error'); -const IncomeError = require('./income-error'); -const LoanError = require('./loan-error'); -const LoginPasswordFailedError = require('./login-password-failed-error'); -const UserError = require('./user-error'); -const VendorError = require('./vendor-error'); +export class AttachmentError extends Error { + constructor(message) { + super(message); + this.name = 'AttachmentError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'No open queries': + return { + message: 'Expense ID is required.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find attachment.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class AuditError extends Error { + constructor(message) { + super(message); + this.name = 'AuditError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class BudgetError extends Error { + constructor(message) { + super(message); + this.name = 'BudgetError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Duplicate budget': + return { + message: 'A budget already exists for that month.', + status: 403, + }; + case 'Invalid month': + return { + message: 'Invalid month provided.', + status: 403, + }; + case 'Invalid notes': + return { + message: 'Invalid notes provided.', + status: 403, + }; + case 'Invalid year': + return { + message: 'Invalid year provided.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find budget.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class CategoryError extends Error { + constructor(message) { + super(message); + this.name = 'CategoryError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Cannot delete with budgets': + return { + message: 'Cannot delete when there are budgets remaining.', + status: 422, + }; + case 'Cannot delete with expenses': + return { + message: 'Cannot delete when there are expenses remaining.', + status: 422, + }; + case 'Cannot delete with subcategories': + return { + message: 'Cannot delete when there are subcategories remaining.', + status: 422, + }; + case 'Invalid year': + return { + message: 'Invalid ID provided.', + status: 403, + }; + case 'No open queries': + return { + message: 'Category ID is required.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find category.', + status: 404, + }; + case 'Parent category not found': + return { + message: 'Could not find parent category.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class EmployerError extends Error { + constructor(message) { + super(message); + this.name = 'EmployerError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Not found': + return { + message: 'Unable to find employer.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class ExpenseError extends Error { + constructor(message) { + super(message); + this.name = 'ExpenseError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'No open queries': + return { + message: 'Subcategory or vendor ID is required.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find expense.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class FundError extends Error { + constructor(message) { + super(message); + this.name = 'FundError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Deposit not found': + return { + message: 'Unable to find deposit.', + status: 404, + }; + case 'No open deposit queries': + return { + message: 'Fund ID is required.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find fund.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class HouseholdError extends Error { + constructor(message) { + super(message); + this.name = 'HouseholdError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Cannot delete with expenses': + return { + message: 'Cannot delete when there are expenses remaining.', + status: 422, + }; + case 'Not found': + return { + message: 'Unable to find member.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class IncomeError extends Error { + constructor(message) { + super(message); + this.name = 'IncomeError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Not found': + return { + message: 'Unable to find income.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class LoanError extends Error { + constructor(message) { + super(message); + this.name = 'LoanError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Not found': + return { + message: 'Unable to find loan.', + status: 404, + }; + case 'Loan payment not found': + return { + message: 'Unable to find loan payment.', + status: 404, + }; + case 'No open loan payment queries': + return { + message: 'Loan ID is required.', + status: 403, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class LoginPasswordFailedError extends Error { + constructor(message) { + super(message); + this.name = 'LoginPasswordFailedError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + default: + return { + message: 'Invalid email/password combination.', + status: 403, + }; + } + } +}; + +export class UserError extends Error { + constructor(message) { + super(message); + this.name = 'UserError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Email already exists': + return { + message: 'That email address is already taken.', + status: 403, + }; + case 'Not found': + return { + message: 'Unable to find user.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + +export class VendorError extends Error { + constructor(message) { + super(message); + this.name = 'VendorError'; + } + + getApiResponse() { + const message = this.message; + switch (message) { + case 'Cannot delete with expenses': + return { + message: 'Cannot delete when there are expenses remaining.', + status: 422, + }; + case 'Not found': + return { + message: 'Unable to find vendor.', + status: 404, + }; + default: + return { + message: 'An error occurred. Please try again later.', + status: 500, + }; + } + } +}; + const errorClasses = { AttachmentError, @@ -28,28 +399,26 @@ const errorClasses = { VendorError, }; -module.exports = { - ...errorClasses, - middleware(err, req, res, next) { - if (err - && Object.keys(errorClasses).includes(err.name)) { - const logger = req.app.get('logger'); - logger.error('Error:', err); - const { message, status } = err.getApiResponse(); - return res.status(status).json({ - errors: [{ - detail: message, - }], - }); - } - if (err.name === 'JsonWebTokenError') { - return res.status(403).json({ - errors: [{ - detail: 'Unauthorized', - }], - }); - } - return next(err); - }, -}; +export function middleware(err, req, res, next) { + if (err + && Object.keys(errorClasses).includes(err.name)) { + const logger = req.app.get('logger'); + logger.error('Error:', err); + const { message, status } = err.getApiResponse(); + return res.status(status).json({ + errors: [{ + detail: message, + }], + }); + } + if (err.name === 'JsonWebTokenError') { + return res.status(403).json({ + errors: [{ + detail: 'Unauthorized', + }], + }); + } + + return next(err); +} diff --git a/app/middleware/error-handler/loan-error.js b/app/middleware/error-handler/loan-error.js index c8262723..d97a8501 100644 --- a/app/middleware/error-handler/loan-error.js +++ b/app/middleware/error-handler/loan-error.js @@ -1,4 +1,4 @@ -module.exports = class LoanError extends Error { +export class LoanError extends Error { constructor(message) { super(message); this.name = 'LoanError'; diff --git a/app/middleware/error-handler/login-password-failed-error.js b/app/middleware/error-handler/login-password-failed-error.js index 8d9c9e2e..0c12d976 100644 --- a/app/middleware/error-handler/login-password-failed-error.js +++ b/app/middleware/error-handler/login-password-failed-error.js @@ -1,4 +1,4 @@ -module.exports = class LoginPasswordFailedError extends Error { +export class LoginPasswordFailedError extends Error { constructor(message) { super(message); this.name = 'LoginPasswordFailedError'; diff --git a/app/middleware/error-handler/user-error.js b/app/middleware/error-handler/user-error.js index 18668b8a..66e1df0a 100644 --- a/app/middleware/error-handler/user-error.js +++ b/app/middleware/error-handler/user-error.js @@ -1,4 +1,4 @@ -module.exports = class UserError extends Error { +export class UserError extends Error { constructor(message) { super(message); this.name = 'UserError'; diff --git a/app/middleware/error-handler/vendor-error.js b/app/middleware/error-handler/vendor-error.js index 2c81fc04..82211502 100644 --- a/app/middleware/error-handler/vendor-error.js +++ b/app/middleware/error-handler/vendor-error.js @@ -1,4 +1,4 @@ -module.exports = class VendorError extends Error { +export class VendorError extends Error { constructor(message) { super(message); this.name = 'VendorError'; diff --git a/app/middleware/index.js b/app/middleware/index.js index 97dfa6bd..ede23ef7 100644 --- a/app/middleware/index.js +++ b/app/middleware/index.js @@ -1,11 +1,4 @@ -const Auditor = require('./auditor'); -const Authentication = require('./authentication'); -const ErrorHandler = require('./error-handler'); -const Validator = require('./validator'); - -module.exports = { - Auditor, - Authentication, - ErrorHandler, - Validator, -}; +export { default as Auditor } from './auditor/index.js'; +export { default as Authentication } from './authentication/index.js'; +export { middleware as ErrorHandlerMiddleware } from './error-handler/index.js'; +export { default as Validator } from './validator/index.js'; diff --git a/app/middleware/validator/index.js b/app/middleware/validator/index.js index 4d1cd4b1..e943d10f 100644 --- a/app/middleware/validator/index.js +++ b/app/middleware/validator/index.js @@ -1,7 +1,7 @@ -const { validationResult } = require('express-validator'); -const _ = require('lodash'); +import { validationResult } from 'express-validator'; +import _ from 'lodash'; -module.exports = { +export default class Validator { validateRequest() { return (req, res, next) => { const errors = validationResult(req); @@ -19,5 +19,5 @@ module.exports = { } return next(); }; - }, -}; + } +} diff --git a/app/models/attachment.js b/app/models/attachment.js index 399b4866..98299b6a 100644 --- a/app/models/attachment.js +++ b/app/models/attachment.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Attachment', { aws_bucket: { allowNull: true, diff --git a/app/models/audit/api-call.js b/app/models/audit/api-call.js index 9cf412d7..d8af72a0 100644 --- a/app/models/audit/api-call.js +++ b/app/models/audit/api-call.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('AuditApiCall', { created_at: { allowNull: false, diff --git a/app/models/audit/change.js b/app/models/audit/change.js index e5b3e4a9..2f083ea1 100644 --- a/app/models/audit/change.js +++ b/app/models/audit/change.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('AuditChange', { attribute: { allowNull: false, diff --git a/app/models/audit/index.js b/app/models/audit/index.js index 3e6d19fd..759d90b6 100644 --- a/app/models/audit/index.js +++ b/app/models/audit/index.js @@ -1,8 +1,8 @@ -const ApiCall = require('./api-call'); -const Change = require('./change'); -const Log = require('./log'); +import ApiCall from './api-call.js'; +import Change from './change.js'; +import Log from './log.js'; -module.exports = (sequelize) => { +export default (sequelize) => { return { ApiCall: ApiCall(sequelize), Change: Change(sequelize), diff --git a/app/models/audit/log.js b/app/models/audit/log.js index bca283b5..c606f266 100644 --- a/app/models/audit/log.js +++ b/app/models/audit/log.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('AuditLog', { audit_api_call_uuid: { allowNull: true, diff --git a/app/models/budget.js b/app/models/budget.js index e5441931..b9c507f6 100644 --- a/app/models/budget.js +++ b/app/models/budget.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Budget', { amount_cents: { allowNull: false, diff --git a/app/models/category.js b/app/models/category.js index b0e766cb..dfd2bfc9 100644 --- a/app/models/category.js +++ b/app/models/category.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Category', { created_at: { allowNull: false, diff --git a/app/models/deposit.js b/app/models/deposit.js index dac7a93e..221764f7 100644 --- a/app/models/deposit.js +++ b/app/models/deposit.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { + export default (sequelize) => { return sequelize.define('Deposit', { amount_cents: { allowNull: false, diff --git a/app/models/employer.js b/app/models/employer.js index ec49fdd4..0bf6e375 100644 --- a/app/models/employer.js +++ b/app/models/employer.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Employer', { created_at: { allowNull: false, diff --git a/app/models/expense.js b/app/models/expense.js index 1089fd6d..bab1333d 100644 --- a/app/models/expense.js +++ b/app/models/expense.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Expense', { amount_cents: { allowNull: false, diff --git a/app/models/fund.js b/app/models/fund.js index 9a0c5a9a..872c8739 100644 --- a/app/models/fund.js +++ b/app/models/fund.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Fund', { balance_cents: { allowNull: false, diff --git a/app/models/hash.js b/app/models/hash.js index 123b52da..ce81f910 100644 --- a/app/models/hash.js +++ b/app/models/hash.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Hash', { h1: { allowNull: false, diff --git a/app/models/household-member.js b/app/models/household-member.js index 43cc08cd..aedafd2f 100644 --- a/app/models/household-member.js +++ b/app/models/household-member.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('HouseholdMember', { created_at: { allowNull: false, diff --git a/app/models/household.js b/app/models/household.js index 1d41858e..18539f6d 100644 --- a/app/models/household.js +++ b/app/models/household.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Household', { created_at: { allowNull: false, diff --git a/app/models/income.js b/app/models/income.js index 4e8312f1..ebdbe368 100644 --- a/app/models/income.js +++ b/app/models/income.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Income', { amount_cents: { allowNull: false, diff --git a/app/models/index.js b/app/models/index.js index 273abe5a..bfa0a90f 100644 --- a/app/models/index.js +++ b/app/models/index.js @@ -1,26 +1,26 @@ -const nconf = require('nconf'); -const Sequelize = require('sequelize'); - -const Attachment = require('./attachment'); -const Audit = require('./audit'); -const Budget = require('./budget'); -const Category = require('./category'); -const Deposit = require('./deposit'); -const Employer = require('./employer'); -const Expense = require('./expense'); -const Fund = require('./fund'); -const Hash = require('./hash'); -const Household = require('./household'); -const HouseholdMember = require('./household-member'); -const Income = require('./income'); -const Loan = require('./loan'); -const LoanPayment = require('./loan-payment'); -const Subcategory = require('./subcategory'); -const User = require('./user'); -const UserLogin = require('./user-login'); -const Vendor = require('./vendor'); - -class Models { +import nconf from 'nconf'; +import Sequelize from 'sequelize'; + +import Attachment from './attachment.js'; +import Audit from './audit/index.js'; +import Budget from './budget.js'; +import Category from './category.js'; +import Deposit from './deposit.js'; +import Employer from './employer.js'; +import Expense from './expense.js'; +import Fund from './fund.js'; +import Hash from './hash.js'; +import Household from './household.js'; +import HouseholdMember from './household-member.js'; +import Income from './income.js'; +import Loan from './loan.js'; +import LoanPayment from './loan-payment.js'; +import Subcategory from './subcategory.js'; +import User from './user.js'; +import UserLogin from './user-login.js'; +import Vendor from './vendor.js'; + +export default class Models { constructor(databaseUrl) { let logging = console.log; // eslint-disable-line no-console if (nconf.get('NODE_ENV') === 'test') { @@ -237,5 +237,3 @@ class Models { }); } } - -module.exports = Models; diff --git a/app/models/loan-payment.js b/app/models/loan-payment.js index e72d2f9a..a4b12064 100644 --- a/app/models/loan-payment.js +++ b/app/models/loan-payment.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('LoanPayment', { created_at: { allowNull: false, diff --git a/app/models/loan.js b/app/models/loan.js index 34af2d5a..3300739f 100644 --- a/app/models/loan.js +++ b/app/models/loan.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Loan', { amount_cents: { allowNull: false, diff --git a/app/models/subcategory.js b/app/models/subcategory.js index 515d9c17..8e2ac8e9 100644 --- a/app/models/subcategory.js +++ b/app/models/subcategory.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Subcategory', { category_uuid: { allowNull: false, diff --git a/app/models/user-login.js b/app/models/user-login.js index 4fe27b11..c71b9252 100644 --- a/app/models/user-login.js +++ b/app/models/user-login.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('UserLogin', { created_at: { allowNull: false, diff --git a/app/models/user.js b/app/models/user.js index 990c22d9..8d729cfb 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('User', { created_at: { allowNull: false, diff --git a/app/models/vendor.js b/app/models/vendor.js index f6bd17bb..f5764f2e 100644 --- a/app/models/vendor.js +++ b/app/models/vendor.js @@ -1,6 +1,6 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -module.exports = (sequelize) => { +export default (sequelize) => { return sequelize.define('Vendor', { created_at: { allowNull: false, diff --git a/app/routes/attachments/get.js b/app/routes/attachments/get.js index 25edc223..5ec03d1e 100644 --- a/app/routes/attachments/get.js +++ b/app/routes/attachments/get.js @@ -1,8 +1,8 @@ -const { GetObjectCommand } = require('@aws-sdk/client-s3'); -const nconf = require('nconf'); -const { AttachmentError, ExpenseError } = require('../../middleware/error-handler'); +import { GetObjectCommand } from '@aws-sdk/client-s3'; +import nconf from 'nconf'; +import { AttachmentError, ExpenseError } from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/attachments/index.js b/app/routes/attachments/index.js index 70c1cbe0..1990ebd9 100644 --- a/app/routes/attachments/index.js +++ b/app/routes/attachments/index.js @@ -1,10 +1,10 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; -const routeItem = require('./item'); +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/attachments/item/delete.js b/app/routes/attachments/item/delete.js index 18b72729..c763cc21 100644 --- a/app/routes/attachments/item/delete.js +++ b/app/routes/attachments/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/attachments/item/get.js b/app/routes/attachments/item/get.js index 542a95ef..6dbbb70f 100644 --- a/app/routes/attachments/item/get.js +++ b/app/routes/attachments/item/get.js @@ -1,8 +1,8 @@ -const { GetObjectCommand } = require('@aws-sdk/client-s3'); -const nconf = require('nconf'); -const { AttachmentError } = require('../../../middleware/error-handler'); +import { GetObjectCommand } from '@aws-sdk/client-s3'; +import nconf from 'nconf'; +import { AttachmentError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/attachments/item/index.js b/app/routes/attachments/item/index.js index 20286a02..825b01f2 100644 --- a/app/routes/attachments/item/index.js +++ b/app/routes/attachments/item/index.js @@ -1,10 +1,10 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); -const routeUpload = require('./upload'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; +import routeUpload from './upload/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/attachments/item/patch.js b/app/routes/attachments/item/patch.js index e6b64b74..e57f0db3 100644 --- a/app/routes/attachments/item/patch.js +++ b/app/routes/attachments/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/attachments/item/upload/index.js b/app/routes/attachments/item/upload/index.js index 3523268e..603ab855 100644 --- a/app/routes/attachments/item/upload/index.js +++ b/app/routes/attachments/item/upload/index.js @@ -1,9 +1,9 @@ -const multer = require('multer'); -const postFn = require('./post'); +import multer from 'multer'; +import postFn from './post.js'; const upload = multer(); -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); diff --git a/app/routes/attachments/item/upload/post.js b/app/routes/attachments/item/upload/post.js index 6c33151b..9be8f8c1 100644 --- a/app/routes/attachments/item/upload/post.js +++ b/app/routes/attachments/item/upload/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/attachments/post.js b/app/routes/attachments/post.js index 53feafd4..1ce55c55 100644 --- a/app/routes/attachments/post.js +++ b/app/routes/attachments/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/budget-reports/get.js b/app/routes/budget-reports/get.js index 1384d832..069fd457 100644 --- a/app/routes/budget-reports/get.js +++ b/app/routes/budget-reports/get.js @@ -1,9 +1,9 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); return async(req, res, next) => { diff --git a/app/routes/budget-reports/index.js b/app/routes/budget-reports/index.js index 60d6f758..08af9af5 100644 --- a/app/routes/budget-reports/index.js +++ b/app/routes/budget-reports/index.js @@ -1,6 +1,6 @@ -const getFn = require('./get'); +import getFn from './get.js'; -module.exports = (router, app) => { +export default (router, app) => { const Authentication = app.get('Authentication'); router.route('/') diff --git a/app/routes/budgets/get.js b/app/routes/budgets/get.js index fd298fe2..87542319 100644 --- a/app/routes/budgets/get.js +++ b/app/routes/budgets/get.js @@ -1,6 +1,6 @@ -const { BudgetError, CategoryError } = require('../../middleware/error-handler'); +import { BudgetError, CategoryError } from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/budgets/index.js b/app/routes/budgets/index.js index b59a775d..5509b0c1 100644 --- a/app/routes/budgets/index.js +++ b/app/routes/budgets/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/budgets/item/delete.js b/app/routes/budgets/item/delete.js index 8fdc8957..ffe3bc55 100644 --- a/app/routes/budgets/item/delete.js +++ b/app/routes/budgets/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/budgets/item/get.js b/app/routes/budgets/item/get.js index 3c760f39..fbf131be 100644 --- a/app/routes/budgets/item/get.js +++ b/app/routes/budgets/item/get.js @@ -1,6 +1,6 @@ -const { BudgetError } = require('../../../middleware/error-handler'); +import { BudgetError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/budgets/item/index.js b/app/routes/budgets/item/index.js index 5a469d73..f096378b 100644 --- a/app/routes/budgets/item/index.js +++ b/app/routes/budgets/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/budgets/item/patch.js b/app/routes/budgets/item/patch.js index a5f5024b..a5fbe378 100644 --- a/app/routes/budgets/item/patch.js +++ b/app/routes/budgets/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/budgets/post.js b/app/routes/budgets/post.js index a7a51b79..a32c0a87 100644 --- a/app/routes/budgets/post.js +++ b/app/routes/budgets/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/categories/get.js b/app/routes/categories/get.js index 98ddc90d..52357a84 100644 --- a/app/routes/categories/get.js +++ b/app/routes/categories/get.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/categories/index.js b/app/routes/categories/index.js index ac57f501..da327fdc 100644 --- a/app/routes/categories/index.js +++ b/app/routes/categories/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/categories/item/delete.js b/app/routes/categories/item/delete.js index 4667126a..8f07adf5 100644 --- a/app/routes/categories/item/delete.js +++ b/app/routes/categories/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/categories/item/get.js b/app/routes/categories/item/get.js index e9fd75ad..2468e86a 100644 --- a/app/routes/categories/item/get.js +++ b/app/routes/categories/item/get.js @@ -1,10 +1,10 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../../middleware/error-handler'); +import { CategoryError } from '../../../middleware/error-handler/index.js'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/categories/item/index.js b/app/routes/categories/item/index.js index 35c14f1a..abaa4203 100644 --- a/app/routes/categories/item/index.js +++ b/app/routes/categories/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/categories/item/patch.js b/app/routes/categories/item/patch.js index 8612e5c8..1e93edc0 100644 --- a/app/routes/categories/item/patch.js +++ b/app/routes/categories/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/categories/post.js b/app/routes/categories/post.js index d8ace7f4..fe680a1a 100644 --- a/app/routes/categories/post.js +++ b/app/routes/categories/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/deposits/get.js b/app/routes/deposits/get.js index 2a04b3db..a381c9d3 100644 --- a/app/routes/deposits/get.js +++ b/app/routes/deposits/get.js @@ -1,6 +1,6 @@ -const { FundError } = require('../../middleware/error-handler'); +import { FundError } from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/deposits/index.js b/app/routes/deposits/index.js index caf756af..7cbe4b9e 100644 --- a/app/routes/deposits/index.js +++ b/app/routes/deposits/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/deposits/item/delete.js b/app/routes/deposits/item/delete.js index c3dba0ef..2b84f971 100644 --- a/app/routes/deposits/item/delete.js +++ b/app/routes/deposits/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/deposits/item/get.js b/app/routes/deposits/item/get.js index 530e5e79..0cad921c 100644 --- a/app/routes/deposits/item/get.js +++ b/app/routes/deposits/item/get.js @@ -1,6 +1,6 @@ -const { FundError } = require('../../../middleware/error-handler'); +import { FundError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/deposits/item/index.js b/app/routes/deposits/item/index.js index d5944bba..0c6989cd 100644 --- a/app/routes/deposits/item/index.js +++ b/app/routes/deposits/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/deposits/item/patch.js b/app/routes/deposits/item/patch.js index 5f240296..71cebf67 100644 --- a/app/routes/deposits/item/patch.js +++ b/app/routes/deposits/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/deposits/post.js b/app/routes/deposits/post.js index 76d2704e..bf5525fa 100644 --- a/app/routes/deposits/post.js +++ b/app/routes/deposits/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/employers/get.js b/app/routes/employers/get.js index d3a45138..9991cefd 100644 --- a/app/routes/employers/get.js +++ b/app/routes/employers/get.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/employers/index.js b/app/routes/employers/index.js index 099d20bb..b4ba7782 100644 --- a/app/routes/employers/index.js +++ b/app/routes/employers/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/employers/item/delete.js b/app/routes/employers/item/delete.js index 2334f230..24835605 100644 --- a/app/routes/employers/item/delete.js +++ b/app/routes/employers/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/employers/item/get.js b/app/routes/employers/item/get.js index d4c17787..5cd33c29 100644 --- a/app/routes/employers/item/get.js +++ b/app/routes/employers/item/get.js @@ -1,6 +1,6 @@ -const { EmployerError } = require('../../../middleware/error-handler'); +import { EmployerError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/employers/item/index.js b/app/routes/employers/item/index.js index 8d553d9a..545c6400 100644 --- a/app/routes/employers/item/index.js +++ b/app/routes/employers/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/employers/item/patch.js b/app/routes/employers/item/patch.js index 60cfa26a..7492f690 100644 --- a/app/routes/employers/item/patch.js +++ b/app/routes/employers/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/employers/post.js b/app/routes/employers/post.js index c3a092b4..69731eb1 100644 --- a/app/routes/employers/post.js +++ b/app/routes/employers/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/expenses/get.js b/app/routes/expenses/get.js index 21bc1e05..f5ab00c0 100644 --- a/app/routes/expenses/get.js +++ b/app/routes/expenses/get.js @@ -1,12 +1,12 @@ -const { +import { CategoryError, ExpenseError, FundError, HouseholdError, VendorError, -} = require('../../middleware/error-handler'); +} from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/expenses/index.js b/app/routes/expenses/index.js index 4de70972..91990de9 100644 --- a/app/routes/expenses/index.js +++ b/app/routes/expenses/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/expenses/item/delete.js b/app/routes/expenses/item/delete.js index da250400..18c46abf 100644 --- a/app/routes/expenses/item/delete.js +++ b/app/routes/expenses/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/expenses/item/get.js b/app/routes/expenses/item/get.js index bb4af055..f27e1472 100644 --- a/app/routes/expenses/item/get.js +++ b/app/routes/expenses/item/get.js @@ -1,6 +1,6 @@ -const { ExpenseError } = require('../../../middleware/error-handler'); +import { ExpenseError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/expenses/item/index.js b/app/routes/expenses/item/index.js index 1610b05d..4454230e 100644 --- a/app/routes/expenses/item/index.js +++ b/app/routes/expenses/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/expenses/item/patch.js b/app/routes/expenses/item/patch.js index 4a728834..5465e43d 100644 --- a/app/routes/expenses/item/patch.js +++ b/app/routes/expenses/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/expenses/post.js b/app/routes/expenses/post.js index 04ff5b69..6cc38170 100644 --- a/app/routes/expenses/post.js +++ b/app/routes/expenses/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/funds/get.js b/app/routes/funds/get.js index 8c1c63ac..6a5df700 100644 --- a/app/routes/funds/get.js +++ b/app/routes/funds/get.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/funds/index.js b/app/routes/funds/index.js index d6ba6846..ee0ee4e6 100644 --- a/app/routes/funds/index.js +++ b/app/routes/funds/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/funds/item/delete.js b/app/routes/funds/item/delete.js index 7898a849..17110f13 100644 --- a/app/routes/funds/item/delete.js +++ b/app/routes/funds/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/funds/item/get.js b/app/routes/funds/item/get.js index f5e183ac..f3d3d644 100644 --- a/app/routes/funds/item/get.js +++ b/app/routes/funds/item/get.js @@ -1,6 +1,6 @@ -const { FundError } = require('../../../middleware/error-handler'); +import { FundError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/funds/item/index.js b/app/routes/funds/item/index.js index 5f693e90..2507e87b 100644 --- a/app/routes/funds/item/index.js +++ b/app/routes/funds/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/funds/item/patch.js b/app/routes/funds/item/patch.js index 9e13b3c9..fbb1cad1 100644 --- a/app/routes/funds/item/patch.js +++ b/app/routes/funds/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/funds/post.js b/app/routes/funds/post.js index c3763937..46a7e5f5 100644 --- a/app/routes/funds/post.js +++ b/app/routes/funds/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/household-members/get.js b/app/routes/household-members/get.js index 76bf8147..bdfba775 100644 --- a/app/routes/household-members/get.js +++ b/app/routes/household-members/get.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); return async(req, res, next) => { diff --git a/app/routes/household-members/index.js b/app/routes/household-members/index.js index b7e82f7b..b19cb3aa 100644 --- a/app/routes/household-members/index.js +++ b/app/routes/household-members/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/household-members/item/delete.js b/app/routes/household-members/item/delete.js index 2d310180..29fc80f0 100644 --- a/app/routes/household-members/item/delete.js +++ b/app/routes/household-members/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/household-members/item/get.js b/app/routes/household-members/item/get.js index 2e35c279..f93a36be 100644 --- a/app/routes/household-members/item/get.js +++ b/app/routes/household-members/item/get.js @@ -1,6 +1,6 @@ -const { HouseholdError } = require('../../../middleware/error-handler'); +import { HouseholdError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/household-members/item/index.js b/app/routes/household-members/item/index.js index 5a02fdcf..f353ef9f 100644 --- a/app/routes/household-members/item/index.js +++ b/app/routes/household-members/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/household-members/item/patch.js b/app/routes/household-members/item/patch.js index 8dd9241b..9cd3d6bc 100644 --- a/app/routes/household-members/item/patch.js +++ b/app/routes/household-members/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/household-members/post.js b/app/routes/household-members/post.js index b9aca03f..5c967a26 100644 --- a/app/routes/household-members/post.js +++ b/app/routes/household-members/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/households/index.js b/app/routes/households/index.js index 4370f193..5b65de7f 100644 --- a/app/routes/households/index.js +++ b/app/routes/households/index.js @@ -1,6 +1,6 @@ -const routeItem = require('./item'); +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { routeItem(router, app); return router; diff --git a/app/routes/households/item/get.js b/app/routes/households/item/get.js index 64734197..a7640a15 100644 --- a/app/routes/households/item/get.js +++ b/app/routes/households/item/get.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/households/item/index.js b/app/routes/households/item/index.js index f6231b64..3e052362 100644 --- a/app/routes/households/item/index.js +++ b/app/routes/households/item/index.js @@ -1,6 +1,6 @@ -const getFn = require('./get'); +import getFn from './get.js'; -module.exports = (router, app) => { +export default (router, app) => { const Authentication = app.get('Authentication'); router.route('/:uuid') diff --git a/app/routes/incomes/get.js b/app/routes/incomes/get.js index 2d27ddc2..0be6d03c 100644 --- a/app/routes/incomes/get.js +++ b/app/routes/incomes/get.js @@ -1,9 +1,9 @@ -const { +import { EmployerError, HouseholdError, -} = require('../../middleware/error-handler'); +} from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/incomes/index.js b/app/routes/incomes/index.js index d954839c..1a22bce6 100644 --- a/app/routes/incomes/index.js +++ b/app/routes/incomes/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/incomes/item/delete.js b/app/routes/incomes/item/delete.js index d0136612..32b96316 100644 --- a/app/routes/incomes/item/delete.js +++ b/app/routes/incomes/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/incomes/item/get.js b/app/routes/incomes/item/get.js index 5598b8af..008b0f37 100644 --- a/app/routes/incomes/item/get.js +++ b/app/routes/incomes/item/get.js @@ -1,6 +1,6 @@ -const { IncomeError } = require('../../../middleware/error-handler'); +import { IncomeError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/incomes/item/index.js b/app/routes/incomes/item/index.js index af0f9873..56f0c11d 100644 --- a/app/routes/incomes/item/index.js +++ b/app/routes/incomes/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/incomes/item/patch.js b/app/routes/incomes/item/patch.js index 8960b51d..210d4c8f 100644 --- a/app/routes/incomes/item/patch.js +++ b/app/routes/incomes/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/incomes/post.js b/app/routes/incomes/post.js index dafa06c3..c40704ea 100644 --- a/app/routes/incomes/post.js +++ b/app/routes/incomes/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/index.js b/app/routes/index.js index 334db8b2..1689b184 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -1,25 +1,25 @@ -const express = require('express'); +import express from 'express'; -const attachments = require('./attachments'); -const budgetReports = require('./budget-reports'); -const budgets = require('./budgets'); -const categories = require('./categories'); -const deposits = require('./deposits'); -const employers = require('./employers'); -const expenses = require('./expenses'); -const funds = require('./funds'); -const householdMembers = require('./household-members'); -const households = require('./households'); -const incomes = require('./incomes'); -const loanPayments = require('./loan-payments'); -const loans = require('./loans'); -const monthlyReports = require('./monthly-reports'); -const subcategories = require('./subcategories'); -const subcategoryAnnualReports = require('./subcategory-annual-reports'); -const users = require('./users'); -const vendors = require('./vendors'); +import attachments from './attachments/index.js'; +import budgetReports from './budget-reports/index.js'; +import budgets from './budgets/index.js'; +import categories from './categories/index.js'; +import deposits from './deposits/index.js'; +import employers from './employers/index.js'; +import expenses from './expenses/index.js'; +import funds from './funds/index.js'; +import householdMembers from './household-members/index.js'; +import households from './households/index.js'; +import incomes from './incomes/index.js'; +import loanPayments from './loan-payments/index.js'; +import loans from './loans/index.js'; +import monthlyReports from './monthly-reports/index.js'; +import subcategories from './subcategories/index.js'; +import subcategoryAnnualReports from './subcategory-annual-reports/index.js'; +import users from './users/index.js'; +import vendors from './vendors/index.js'; -module.exports = (app) => { +export default (app) => { app.use('/attachments', attachments(express.Router(), app)); app.use('/budget-reports', budgetReports(express.Router(), app)); app.use('/budgets', budgets(express.Router(), app)); diff --git a/app/routes/loan-payments/get.js b/app/routes/loan-payments/get.js index 2573b04d..e610f936 100644 --- a/app/routes/loan-payments/get.js +++ b/app/routes/loan-payments/get.js @@ -1,6 +1,6 @@ -const { LoanError } = require('../../middleware/error-handler'); +import { LoanError } from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/loan-payments/index.js b/app/routes/loan-payments/index.js index bc04fbae..173c52be 100644 --- a/app/routes/loan-payments/index.js +++ b/app/routes/loan-payments/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/loan-payments/item/delete.js b/app/routes/loan-payments/item/delete.js index ad642cac..abc9cee9 100644 --- a/app/routes/loan-payments/item/delete.js +++ b/app/routes/loan-payments/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); return async(req, res, next) => { diff --git a/app/routes/loan-payments/item/get.js b/app/routes/loan-payments/item/get.js index 2927f976..f09d38f7 100644 --- a/app/routes/loan-payments/item/get.js +++ b/app/routes/loan-payments/item/get.js @@ -1,6 +1,6 @@ -const { LoanError } = require('../../../middleware/error-handler'); +import { LoanError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/loan-payments/item/index.js b/app/routes/loan-payments/item/index.js index eee79971..947065f8 100644 --- a/app/routes/loan-payments/item/index.js +++ b/app/routes/loan-payments/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/loan-payments/item/patch.js b/app/routes/loan-payments/item/patch.js index 99ecda0a..fc54808d 100644 --- a/app/routes/loan-payments/item/patch.js +++ b/app/routes/loan-payments/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/loan-payments/post.js b/app/routes/loan-payments/post.js index f4fcceea..48d37665 100644 --- a/app/routes/loan-payments/post.js +++ b/app/routes/loan-payments/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/loans/get.js b/app/routes/loans/get.js index 2a6d44b5..514e1f5c 100644 --- a/app/routes/loans/get.js +++ b/app/routes/loans/get.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/loans/index.js b/app/routes/loans/index.js index 5162a038..f6660c94 100644 --- a/app/routes/loans/index.js +++ b/app/routes/loans/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/loans/item/delete.js b/app/routes/loans/item/delete.js index 55dd9119..ec4cc97e 100644 --- a/app/routes/loans/item/delete.js +++ b/app/routes/loans/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/loans/item/get.js b/app/routes/loans/item/get.js index 3577cc25..627488cc 100644 --- a/app/routes/loans/item/get.js +++ b/app/routes/loans/item/get.js @@ -1,6 +1,6 @@ -const { LoanError } = require('../../../middleware/error-handler'); +import { LoanError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/loans/item/index.js b/app/routes/loans/item/index.js index c849ad10..4d2c0100 100644 --- a/app/routes/loans/item/index.js +++ b/app/routes/loans/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/loans/item/patch.js b/app/routes/loans/item/patch.js index aa341fb7..014b710c 100644 --- a/app/routes/loans/item/patch.js +++ b/app/routes/loans/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/loans/post.js b/app/routes/loans/post.js index 6f2e0758..e6ae9ea3 100644 --- a/app/routes/loans/post.js +++ b/app/routes/loans/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/monthly-reports/index.js b/app/routes/monthly-reports/index.js index 4370f193..5b65de7f 100644 --- a/app/routes/monthly-reports/index.js +++ b/app/routes/monthly-reports/index.js @@ -1,6 +1,6 @@ -const routeItem = require('./item'); +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { routeItem(router, app); return router; diff --git a/app/routes/monthly-reports/item/get.js b/app/routes/monthly-reports/item/get.js index de7a9685..3962069c 100644 --- a/app/routes/monthly-reports/item/get.js +++ b/app/routes/monthly-reports/item/get.js @@ -1,9 +1,9 @@ -const moment = require('moment'); -const Sequelize = require('sequelize'); +import moment from 'moment'; +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); return async(req, res, next) => { diff --git a/app/routes/monthly-reports/item/index.js b/app/routes/monthly-reports/item/index.js index a2c7c541..e9644d92 100644 --- a/app/routes/monthly-reports/item/index.js +++ b/app/routes/monthly-reports/item/index.js @@ -1,6 +1,6 @@ -const getFn = require('./get'); +import getFn from './get.js'; -module.exports = (router, app) => { +export default (router, app) => { const Authentication = app.get('Authentication'); return router.route('/:uuid') diff --git a/app/routes/subcategories/get.js b/app/routes/subcategories/get.js index 8baef9dd..9069298f 100644 --- a/app/routes/subcategories/get.js +++ b/app/routes/subcategories/get.js @@ -1,10 +1,10 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/subcategories/index.js b/app/routes/subcategories/index.js index f7df132c..c7b29df6 100644 --- a/app/routes/subcategories/index.js +++ b/app/routes/subcategories/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/subcategories/item/delete.js b/app/routes/subcategories/item/delete.js index 045300cf..da1476f1 100644 --- a/app/routes/subcategories/item/delete.js +++ b/app/routes/subcategories/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/subcategories/item/get.js b/app/routes/subcategories/item/get.js index b5c51ee0..be43bd80 100644 --- a/app/routes/subcategories/item/get.js +++ b/app/routes/subcategories/item/get.js @@ -1,6 +1,6 @@ -const { CategoryError } = require('../../../middleware/error-handler'); +import { CategoryError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/subcategories/item/index.js b/app/routes/subcategories/item/index.js index 0bc2506e..a8c42d97 100644 --- a/app/routes/subcategories/item/index.js +++ b/app/routes/subcategories/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/subcategories/item/patch.js b/app/routes/subcategories/item/patch.js index 19b7b5cc..21f61593 100644 --- a/app/routes/subcategories/item/patch.js +++ b/app/routes/subcategories/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/subcategories/post.js b/app/routes/subcategories/post.js index b4abb2b4..6a4692ac 100644 --- a/app/routes/subcategories/post.js +++ b/app/routes/subcategories/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/subcategory-annual-reports/get.js b/app/routes/subcategory-annual-reports/get.js index 825113d4..f23381ac 100644 --- a/app/routes/subcategory-annual-reports/get.js +++ b/app/routes/subcategory-annual-reports/get.js @@ -1,10 +1,10 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -const { CategoryError } = require('../../middleware/error-handler'); +import { CategoryError } from '../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); return async(req, res, next) => { diff --git a/app/routes/subcategory-annual-reports/index.js b/app/routes/subcategory-annual-reports/index.js index a95976de..49f62d58 100644 --- a/app/routes/subcategory-annual-reports/index.js +++ b/app/routes/subcategory-annual-reports/index.js @@ -1,7 +1,7 @@ -const getFn = require('./get'); -const routeItem = require('./item'); +import getFn from './get.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Authentication = app.get('Authentication'); router.route('/') diff --git a/app/routes/subcategory-annual-reports/item/get.js b/app/routes/subcategory-annual-reports/item/get.js index 7f980332..9ae5a4ec 100644 --- a/app/routes/subcategory-annual-reports/item/get.js +++ b/app/routes/subcategory-annual-reports/item/get.js @@ -1,10 +1,10 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -const { CategoryError } = require('../../../middleware/error-handler'); +import { CategoryError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); return async(req, res, next) => { diff --git a/app/routes/subcategory-annual-reports/item/index.js b/app/routes/subcategory-annual-reports/item/index.js index 8b8ec32c..faecf4d2 100644 --- a/app/routes/subcategory-annual-reports/item/index.js +++ b/app/routes/subcategory-annual-reports/item/index.js @@ -1,6 +1,6 @@ -const getFn = require('./get'); +import getFn from './get.js'; -module.exports = (router, app) => { +export default (router, app) => { const Authentication = app.get('Authentication'); return router.route('/:id') diff --git a/app/routes/users/get.js b/app/routes/users/get.js index 51bcaebb..fd813e94 100644 --- a/app/routes/users/get.js +++ b/app/routes/users/get.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/users/index.js b/app/routes/users/index.js index 8f6a06e6..788c9ca7 100644 --- a/app/routes/users/index.js +++ b/app/routes/users/index.js @@ -1,10 +1,10 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); -const routeLogin = require('./login'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; +import routeLogin from './login/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/users/item/get.js b/app/routes/users/item/get.js index 37181815..0309be3e 100644 --- a/app/routes/users/item/get.js +++ b/app/routes/users/item/get.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/users/item/index.js b/app/routes/users/item/index.js index 73b226c3..38db7956 100644 --- a/app/routes/users/item/index.js +++ b/app/routes/users/item/index.js @@ -1,8 +1,8 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/users/item/patch.js b/app/routes/users/item/patch.js index 8e7f1ba8..889c7ea5 100644 --- a/app/routes/users/item/patch.js +++ b/app/routes/users/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/users/login/index.js b/app/routes/users/login/index.js index 0d52f03a..ac3700b2 100644 --- a/app/routes/users/login/index.js +++ b/app/routes/users/login/index.js @@ -1,8 +1,8 @@ -const { body } = require('express-validator'); -const postFn = require('./post'); -const routeLoginToken = require('./token'); +import { body } from 'express-validator'; +import postFn from './post.js'; +import routeLoginToken from './token/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Validator = app.get('Validator'); router.route('/login') diff --git a/app/routes/users/login/post.js b/app/routes/users/login/post.js index a4ebe168..033ba441 100644 --- a/app/routes/users/login/post.js +++ b/app/routes/users/login/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/users/login/token/index.js b/app/routes/users/login/token/index.js index 275d5f23..2facba91 100644 --- a/app/routes/users/login/token/index.js +++ b/app/routes/users/login/token/index.js @@ -1,7 +1,7 @@ -const { body } = require('express-validator'); -const postFn = require('./post'); +import { body } from 'express-validator'; +import postFn from './post.js'; -module.exports = (router, app) => { +export default (router, app) => { const Validator = app.get('Validator'); router.route('/login/token') diff --git a/app/routes/users/login/token/post.js b/app/routes/users/login/token/post.js index 64022d37..d6503bad 100644 --- a/app/routes/users/login/token/post.js +++ b/app/routes/users/login/token/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/users/post.js b/app/routes/users/post.js index 319cdac3..6a484640 100644 --- a/app/routes/users/post.js +++ b/app/routes/users/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/vendors/get.js b/app/routes/vendors/get.js index 8fc4045d..c8f8be33 100644 --- a/app/routes/vendors/get.js +++ b/app/routes/vendors/get.js @@ -1,8 +1,8 @@ -const Sequelize = require('sequelize'); +import Sequelize from 'sequelize'; const Op = Sequelize.Op; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/vendors/index.js b/app/routes/vendors/index.js index 53f528dc..6ad518b7 100644 --- a/app/routes/vendors/index.js +++ b/app/routes/vendors/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const getFn = require('./get'); -const postFn = require('./post'); -const routeItem = require('./item'); +import { body } from 'express-validator'; +import getFn from './get.js'; +import postFn from './post.js'; +import routeItem from './item/index.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/vendors/item/delete.js b/app/routes/vendors/item/delete.js index 21894caa..6d2ceb54 100644 --- a/app/routes/vendors/item/delete.js +++ b/app/routes/vendors/item/delete.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); /** diff --git a/app/routes/vendors/item/get.js b/app/routes/vendors/item/get.js index aad2e639..ba1d1227 100644 --- a/app/routes/vendors/item/get.js +++ b/app/routes/vendors/item/get.js @@ -1,6 +1,6 @@ -const { VendorError } = require('../../../middleware/error-handler'); +import { VendorError } from '../../../middleware/error-handler/index.js'; -module.exports = (app) => { +export default (app) => { const models = app.get('models'); /** diff --git a/app/routes/vendors/item/index.js b/app/routes/vendors/item/index.js index 13c55ed4..6f12e072 100644 --- a/app/routes/vendors/item/index.js +++ b/app/routes/vendors/item/index.js @@ -1,9 +1,9 @@ -const { body } = require('express-validator'); -const deleteFn = require('./delete'); -const getFn = require('./get'); -const patchFn = require('./patch'); +import { body } from 'express-validator'; +import deleteFn from './delete.js'; +import getFn from './get.js'; +import patchFn from './patch.js'; -module.exports = (router, app) => { +export default (router, app) => { const Auditor = app.get('Auditor'); const Authentication = app.get('Authentication'); const Validator = app.get('Validator'); diff --git a/app/routes/vendors/item/patch.js b/app/routes/vendors/item/patch.js index 72ec1b89..bd5a065e 100644 --- a/app/routes/vendors/item/patch.js +++ b/app/routes/vendors/item/patch.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/app/routes/vendors/post.js b/app/routes/vendors/post.js index 5af8fd43..49041ce4 100644 --- a/app/routes/vendors/post.js +++ b/app/routes/vendors/post.js @@ -1,4 +1,4 @@ -module.exports = (app) => { +export default (app) => { const controllers = app.get('controllers'); const models = app.get('models'); diff --git a/config/index.js b/config/index.js index 2c8e35ad..86e2f55b 100644 --- a/config/index.js +++ b/config/index.js @@ -1,5 +1,5 @@ -require('dotenv').config(); -const nconf = require('nconf'); +import 'dotenv/config' +import nconf from 'nconf'; nconf.use('memory'); nconf.argv(); diff --git a/index.js b/index.js index fcec4e74..4269633b 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ -require('./config'); -const nconf = require('nconf'); -const winston = require('winston'); +import './config/index.js'; +import nconf from 'nconf'; +import winston from 'winston'; -const App = require('./app'); +import App from './app/index.js'; const logger = winston.createLogger({ format: winston.format.combine( diff --git a/migrations/20180616141519-create-households-table.js b/migrations/20180616141519-create-households-table.js index 541487c4..5be25391 100644 --- a/migrations/20180616141519-create-households-table.js +++ b/migrations/20180616141519-create-households-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('households', { @@ -24,10 +24,10 @@ async function up({ context: queryInterface }) { type: Sequelize.STRING, }, }); -} +}; async function down({ context: queryInterface }) { await queryInterface.dropTable('households'); -} +}; -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180616190408-create-users-table.js b/migrations/20180616190408-create-users-table.js index d8235a13..a8d22133 100644 --- a/migrations/20180616190408-create-users-table.js +++ b/migrations/20180616190408-create-users-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('users', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('users'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180618112229-create-user-logins-table.js b/migrations/20180618112229-create-user-logins-table.js index 43cb3210..ab32d978 100644 --- a/migrations/20180618112229-create-user-logins-table.js +++ b/migrations/20180618112229-create-user-logins-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('user_logins', { @@ -34,4 +34,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('user_logins'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180618230743-create-hashes-table.js b/migrations/20180618230743-create-hashes-table.js index 0cdddb74..66ace9e6 100644 --- a/migrations/20180618230743-create-hashes-table.js +++ b/migrations/20180618230743-create-hashes-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('hashes', { @@ -18,4 +18,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('hashes'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180619100433-create-audit-api-calls-table.js b/migrations/20180619100433-create-audit-api-calls-table.js index ad1ab38f..0259e70b 100644 --- a/migrations/20180619100433-create-audit-api-calls-table.js +++ b/migrations/20180619100433-create-audit-api-calls-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('audit_api_calls', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('audit_api_calls'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180619173136-create-audit-logs-table.js b/migrations/20180619173136-create-audit-logs-table.js index ac6bda2d..6043f20d 100644 --- a/migrations/20180619173136-create-audit-logs-table.js +++ b/migrations/20180619173136-create-audit-logs-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('audit_logs', { @@ -30,4 +30,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('audit_logs'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180620110720-create-audit-changes-table.js b/migrations/20180620110720-create-audit-changes-table.js index 8a36799a..b19bcb11 100644 --- a/migrations/20180620110720-create-audit-changes-table.js +++ b/migrations/20180620110720-create-audit-changes-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('audit_changes', { @@ -42,4 +42,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('audit_changes'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180629122108-create-categories-table.js b/migrations/20180629122108-create-categories-table.js index 39d43fd5..bf66236c 100644 --- a/migrations/20180629122108-create-categories-table.js +++ b/migrations/20180629122108-create-categories-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('categories', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('categories'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20180927104854-create-vendors-table.js b/migrations/20180927104854-create-vendors-table.js index af1760b1..afbb417d 100644 --- a/migrations/20180927104854-create-vendors-table.js +++ b/migrations/20180927104854-create-vendors-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('vendors', { @@ -38,4 +38,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('vendors'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20181010001231-create-expenses-table.js b/migrations/20181010001231-create-expenses-table.js index 53c9aa14..fe85dfcb 100644 --- a/migrations/20181010001231-create-expenses-table.js +++ b/migrations/20181010001231-create-expenses-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('expenses', { @@ -58,4 +58,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('expenses'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191108230400-create-household-members-table.js b/migrations/20191108230400-create-household-members-table.js index c8e20c23..c21a5528 100644 --- a/migrations/20191108230400-create-household-members-table.js +++ b/migrations/20191108230400-create-household-members-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('household_members', { @@ -38,4 +38,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('household_members'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191115011122-add-household-member-uuid-to-expenses-table.js b/migrations/20191115011122-add-household-member-uuid-to-expenses-table.js index 26dd20ee..6a4fbf72 100644 --- a/migrations/20191115011122-add-household-member-uuid-to-expenses-table.js +++ b/migrations/20191115011122-add-household-member-uuid-to-expenses-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.addColumn('expenses', 'household_member_uuid', { @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { await queryInterface.removeColumn('expenses', 'household_member_uuid'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191126191742-remove-parent-uuid-from-categories-table.js b/migrations/20191126191742-remove-parent-uuid-from-categories-table.js index 84079018..fb995b09 100644 --- a/migrations/20191126191742-remove-parent-uuid-from-categories-table.js +++ b/migrations/20191126191742-remove-parent-uuid-from-categories-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.removeColumn('categories', 'parent_uuid'); @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { }); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191126191946-create-subcategories-table.js b/migrations/20191126191946-create-subcategories-table.js index f075b89f..72eae347 100644 --- a/migrations/20191126191946-create-subcategories-table.js +++ b/migrations/20191126191946-create-subcategories-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('subcategories', { @@ -38,4 +38,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('subcategories'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191126193457-remove-category-uuid-from-expenses-table.js b/migrations/20191126193457-remove-category-uuid-from-expenses-table.js index 8231ab16..62aa3cfd 100644 --- a/migrations/20191126193457-remove-category-uuid-from-expenses-table.js +++ b/migrations/20191126193457-remove-category-uuid-from-expenses-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.removeColumn('expenses', 'category_uuid'); @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { }); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191126193509-add-subcategory-uuid-to-expenses-table.js b/migrations/20191126193509-add-subcategory-uuid-to-expenses-table.js index 29973a0e..5394547f 100644 --- a/migrations/20191126193509-add-subcategory-uuid-to-expenses-table.js +++ b/migrations/20191126193509-add-subcategory-uuid-to-expenses-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.addColumn('expenses', 'subcategory_uuid', { @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { await queryInterface.removeColumn('expenses', 'subcategory_uuid'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20191215221256-create-budgets-table.js b/migrations/20191215221256-create-budgets-table.js index b9fdca1e..a97d5e59 100644 --- a/migrations/20191215221256-create-budgets-table.js +++ b/migrations/20191215221256-create-budgets-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('budgets', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('budgets'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20200119230722-create-incomes-table.js b/migrations/20200119230722-create-incomes-table.js index 13398fdc..69bd0a3f 100644 --- a/migrations/20200119230722-create-incomes-table.js +++ b/migrations/20200119230722-create-incomes-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('incomes', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('incomes'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20200608114312-rename-budget-amount-cents.js b/migrations/20200608114312-rename-budget-amount-cents.js index 183ff875..cd964859 100644 --- a/migrations/20200608114312-rename-budget-amount-cents.js +++ b/migrations/20200608114312-rename-budget-amount-cents.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.renameColumn('budgets', 'budget_cents', 'amount_cents'); @@ -8,4 +8,4 @@ async function down({ context: queryInterface }) { await queryInterface.renameColumn('budgets', 'amount_cents', 'budget_cents'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20210627163729-create-funds-table.js b/migrations/20210627163729-create-funds-table.js index 1f5a3a61..dcfa1fad 100644 --- a/migrations/20210627163729-create-funds-table.js +++ b/migrations/20210627163729-create-funds-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('funds', { @@ -43,4 +43,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('funds'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20210627165909-create-deposits-table.js b/migrations/20210627165909-create-deposits-table.js index 770e23d5..c8ac0da4 100644 --- a/migrations/20210627165909-create-deposits-table.js +++ b/migrations/20210627165909-create-deposits-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('deposits', { @@ -42,4 +42,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('deposits'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20210627172249-add-fund-uuid-to-expenses-table.js b/migrations/20210627172249-add-fund-uuid-to-expenses-table.js index 6db9d127..7b7deb06 100644 --- a/migrations/20210627172249-add-fund-uuid-to-expenses-table.js +++ b/migrations/20210627172249-add-fund-uuid-to-expenses-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.addColumn('expenses', 'fund_uuid', { @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { await queryInterface.removeColumn('expenses', 'fund_uuid'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20220305173901-add-notes-to-budgets-table.js b/migrations/20220305173901-add-notes-to-budgets-table.js index a2215397..fa469944 100644 --- a/migrations/20220305173901-add-notes-to-budgets-table.js +++ b/migrations/20220305173901-add-notes-to-budgets-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.addColumn('budgets', 'notes', { @@ -12,4 +12,4 @@ async function down({ context: queryInterface }) { await queryInterface.removeColumn('budgets', 'notes'); } -module.exports = { up, down } ; +export { up, down }; diff --git a/migrations/20220324014129-create-attachments-table.js b/migrations/20220324014129-create-attachments-table.js index 681abecf..c2df3a1e 100644 --- a/migrations/20220324014129-create-attachments-table.js +++ b/migrations/20220324014129-create-attachments-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('attachments', { @@ -58,4 +58,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('attachments'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20230213033341-alter-attachments-size-bigint.js b/migrations/20230213033341-alter-attachments-size-bigint.js index 5a4bf9df..beb32d4a 100644 --- a/migrations/20230213033341-alter-attachments-size-bigint.js +++ b/migrations/20230213033341-alter-attachments-size-bigint.js @@ -1,5 +1,4 @@ -const { query } = require('express'); -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.changeColumn('attachments', 'aws_content_length', { @@ -13,4 +12,4 @@ async function down({ context: queryInterface }) { }); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20230629214327-create-loans-table.js b/migrations/20230629214327-create-loans-table.js index b2e600bb..2b177091 100644 --- a/migrations/20230629214327-create-loans-table.js +++ b/migrations/20230629214327-create-loans-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('loans', { @@ -50,4 +50,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('loans'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20230722043052-create-loan-payments-table.js b/migrations/20230722043052-create-loan-payments-table.js index 58ff408f..75399934 100644 --- a/migrations/20230722043052-create-loan-payments-table.js +++ b/migrations/20230722043052-create-loan-payments-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('loan_payments', { @@ -46,4 +46,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('loan_payments'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20240217195721-create-employers-table.js b/migrations/20240217195721-create-employers-table.js index 02764315..cb6ee9f8 100644 --- a/migrations/20240217195721-create-employers-table.js +++ b/migrations/20240217195721-create-employers-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.createTable('employers', { @@ -38,4 +38,4 @@ async function down({ context: queryInterface }) { await queryInterface.dropTable('employers'); } -module.exports = { up, down }; +export { up, down }; diff --git a/migrations/20240317020511-add-employer-uuid-to-incomes-table.js b/migrations/20240317020511-add-employer-uuid-to-incomes-table.js index d9c4e175..df9bb26b 100644 --- a/migrations/20240317020511-add-employer-uuid-to-incomes-table.js +++ b/migrations/20240317020511-add-employer-uuid-to-incomes-table.js @@ -1,4 +1,4 @@ -const { Sequelize } = require('sequelize'); +import { Sequelize } from 'sequelize'; async function up({ context: queryInterface }) { await queryInterface.addColumn('incomes', 'employer_uuid', { @@ -15,4 +15,4 @@ async function down({ context: queryInterface }) { await queryInterface.removeColumn('incomes', 'employer_uuid'); } -module.exports = { up, down }; +export { up, down }; diff --git a/package.json b/package.json index 7c931438..b11c9d5c 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.9.1", "description": "", "main": "index.js", + "type": "module", "scripts": { "coveralls": "nyc report --reporter=text-lcov | coveralls", "lint": "eslint . --ext .js", diff --git a/tests/integration/attachments/delete-test.js b/tests/integration/attachments/delete-test.js index d37e0bf8..211761ea 100644 --- a/tests/integration/attachments/delete-test.js +++ b/tests/integration/attachments/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/get-test.js b/tests/integration/attachments/get-test.js index b3c177fe..c212e774 100644 --- a/tests/integration/attachments/get-test.js +++ b/tests/integration/attachments/get-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/delete-test.js b/tests/integration/attachments/item/delete-test.js index d6fc5fa3..b12de1cf 100644 --- a/tests/integration/attachments/item/delete-test.js +++ b/tests/integration/attachments/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/get-test.js b/tests/integration/attachments/item/get-test.js index 4da00694..7127a98b 100644 --- a/tests/integration/attachments/item/get-test.js +++ b/tests/integration/attachments/item/get-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/options-test.js b/tests/integration/attachments/item/options-test.js index 31984877..d2f687c0 100644 --- a/tests/integration/attachments/item/options-test.js +++ b/tests/integration/attachments/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/patch-test.js b/tests/integration/attachments/item/patch-test.js index 6796de16..e39810ef 100644 --- a/tests/integration/attachments/item/patch-test.js +++ b/tests/integration/attachments/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/post-test.js b/tests/integration/attachments/item/post-test.js index 95dada3a..8ad31699 100644 --- a/tests/integration/attachments/item/post-test.js +++ b/tests/integration/attachments/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/upload/delete-test.js b/tests/integration/attachments/item/upload/delete-test.js index b4300a24..ef76858c 100644 --- a/tests/integration/attachments/item/upload/delete-test.js +++ b/tests/integration/attachments/item/upload/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../../test-helper'); +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/upload/get-test.js b/tests/integration/attachments/item/upload/get-test.js index db6d9e78..56a4e5cb 100644 --- a/tests/integration/attachments/item/upload/get-test.js +++ b/tests/integration/attachments/item/upload/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../../test-helper'); +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/upload/options-test.js b/tests/integration/attachments/item/upload/options-test.js index a409ad8f..5e3ff5d9 100644 --- a/tests/integration/attachments/item/upload/options-test.js +++ b/tests/integration/attachments/item/upload/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../../test-helper'); +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/upload/patch-test.js b/tests/integration/attachments/item/upload/patch-test.js index 4b001a19..095f7e5b 100644 --- a/tests/integration/attachments/item/upload/patch-test.js +++ b/tests/integration/attachments/item/upload/patch-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../../test-helper'); +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/item/upload/post-test.js b/tests/integration/attachments/item/upload/post-test.js index ed608346..1664ba8f 100644 --- a/tests/integration/attachments/item/upload/post-test.js +++ b/tests/integration/attachments/item/upload/post-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const fs = require('fs'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import fs from 'fs'; +import sinon from 'sinon'; -const sampleData = require('../../../../sample-data'); -const TestHelper = require('../../../../test-helper'); +import sampleData from '../../../../sample-data/index.js'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/options-test.js b/tests/integration/attachments/options-test.js index 7bfdd7b3..c5ec7946 100644 --- a/tests/integration/attachments/options-test.js +++ b/tests/integration/attachments/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/patch-test.js b/tests/integration/attachments/patch-test.js index 7973ebc1..557a277d 100644 --- a/tests/integration/attachments/patch-test.js +++ b/tests/integration/attachments/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/attachments/post-test.js b/tests/integration/attachments/post-test.js index d55c39ef..8a0d7b70 100644 --- a/tests/integration/attachments/post-test.js +++ b/tests/integration/attachments/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/delete-test.js b/tests/integration/budget-reports/delete-test.js index cc6509dc..e3875581 100644 --- a/tests/integration/budget-reports/delete-test.js +++ b/tests/integration/budget-reports/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/get-test.js b/tests/integration/budget-reports/get-test.js index e97b4397..8f8b79d5 100644 --- a/tests/integration/budget-reports/get-test.js +++ b/tests/integration/budget-reports/get-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import _ from 'lodash'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/item/delete-test.js b/tests/integration/budget-reports/item/delete-test.js index 33d57054..e000622b 100644 --- a/tests/integration/budget-reports/item/delete-test.js +++ b/tests/integration/budget-reports/item/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/item/get-test.js b/tests/integration/budget-reports/item/get-test.js index dea6f863..11b1c07d 100644 --- a/tests/integration/budget-reports/item/get-test.js +++ b/tests/integration/budget-reports/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/item/options-test.js b/tests/integration/budget-reports/item/options-test.js index 96383061..00bd5735 100644 --- a/tests/integration/budget-reports/item/options-test.js +++ b/tests/integration/budget-reports/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/item/patch-test.js b/tests/integration/budget-reports/item/patch-test.js index 42f78927..8962b8d5 100644 --- a/tests/integration/budget-reports/item/patch-test.js +++ b/tests/integration/budget-reports/item/patch-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/item/post-test.js b/tests/integration/budget-reports/item/post-test.js index 92e24529..d6917d4f 100644 --- a/tests/integration/budget-reports/item/post-test.js +++ b/tests/integration/budget-reports/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/options-test.js b/tests/integration/budget-reports/options-test.js index 65e49bd7..fe9659af 100644 --- a/tests/integration/budget-reports/options-test.js +++ b/tests/integration/budget-reports/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/patch-test.js b/tests/integration/budget-reports/patch-test.js index 4af2eb10..62e98971 100644 --- a/tests/integration/budget-reports/patch-test.js +++ b/tests/integration/budget-reports/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budget-reports/post-test.js b/tests/integration/budget-reports/post-test.js index a2d75202..03430795 100644 --- a/tests/integration/budget-reports/post-test.js +++ b/tests/integration/budget-reports/post-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/delete-test.js b/tests/integration/budgets/delete-test.js index dd3d4170..797867d0 100644 --- a/tests/integration/budgets/delete-test.js +++ b/tests/integration/budgets/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/get-test.js b/tests/integration/budgets/get-test.js index 0c323f95..dc2c26a5 100644 --- a/tests/integration/budgets/get-test.js +++ b/tests/integration/budgets/get-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/item/delete-test.js b/tests/integration/budgets/item/delete-test.js index b1618cf0..e37e44c8 100644 --- a/tests/integration/budgets/item/delete-test.js +++ b/tests/integration/budgets/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/item/get-test.js b/tests/integration/budgets/item/get-test.js index 2ec22941..1d872f0e 100644 --- a/tests/integration/budgets/item/get-test.js +++ b/tests/integration/budgets/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/item/options-test.js b/tests/integration/budgets/item/options-test.js index c37d2aaa..421c08d6 100644 --- a/tests/integration/budgets/item/options-test.js +++ b/tests/integration/budgets/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/item/patch-test.js b/tests/integration/budgets/item/patch-test.js index 7afd1171..55311799 100644 --- a/tests/integration/budgets/item/patch-test.js +++ b/tests/integration/budgets/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/item/post-test.js b/tests/integration/budgets/item/post-test.js index d336745d..88fa138b 100644 --- a/tests/integration/budgets/item/post-test.js +++ b/tests/integration/budgets/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/options-test.js b/tests/integration/budgets/options-test.js index a68d7a1c..baa9dd8b 100644 --- a/tests/integration/budgets/options-test.js +++ b/tests/integration/budgets/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/patch-test.js b/tests/integration/budgets/patch-test.js index 962d7711..c5b9b42c 100644 --- a/tests/integration/budgets/patch-test.js +++ b/tests/integration/budgets/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/budgets/post-test.js b/tests/integration/budgets/post-test.js index 6f440225..484044f0 100644 --- a/tests/integration/budgets/post-test.js +++ b/tests/integration/budgets/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/delete-test.js b/tests/integration/categories/delete-test.js index 69bbf916..a067da52 100644 --- a/tests/integration/categories/delete-test.js +++ b/tests/integration/categories/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/get-test.js b/tests/integration/categories/get-test.js index 392db1a9..34b4ed1f 100644 --- a/tests/integration/categories/get-test.js +++ b/tests/integration/categories/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/item/delete-test.js b/tests/integration/categories/item/delete-test.js index 6c93a714..95458c19 100644 --- a/tests/integration/categories/item/delete-test.js +++ b/tests/integration/categories/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/item/get-test.js b/tests/integration/categories/item/get-test.js index 6cae0ebe..5bd31e12 100644 --- a/tests/integration/categories/item/get-test.js +++ b/tests/integration/categories/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/item/options-test.js b/tests/integration/categories/item/options-test.js index 32b80682..5e51cd18 100644 --- a/tests/integration/categories/item/options-test.js +++ b/tests/integration/categories/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/item/patch-test.js b/tests/integration/categories/item/patch-test.js index 2b36287b..a966dd9d 100644 --- a/tests/integration/categories/item/patch-test.js +++ b/tests/integration/categories/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/item/post-test.js b/tests/integration/categories/item/post-test.js index 05bd2d74..7f1208dd 100644 --- a/tests/integration/categories/item/post-test.js +++ b/tests/integration/categories/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/options-test.js b/tests/integration/categories/options-test.js index bdb41261..7774d4d2 100644 --- a/tests/integration/categories/options-test.js +++ b/tests/integration/categories/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/patch-test.js b/tests/integration/categories/patch-test.js index ca716faf..9941e401 100644 --- a/tests/integration/categories/patch-test.js +++ b/tests/integration/categories/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/categories/post-test.js b/tests/integration/categories/post-test.js index 8b58d8df..f8f73327 100644 --- a/tests/integration/categories/post-test.js +++ b/tests/integration/categories/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/delete-test.js b/tests/integration/delete-test.js index 41abfe58..c568518a 100644 --- a/tests/integration/delete-test.js +++ b/tests/integration/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/delete-test.js b/tests/integration/deposits/delete-test.js index 46740277..529b9815 100644 --- a/tests/integration/deposits/delete-test.js +++ b/tests/integration/deposits/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/get-test.js b/tests/integration/deposits/get-test.js index edac84cf..d6017748 100644 --- a/tests/integration/deposits/get-test.js +++ b/tests/integration/deposits/get-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/item/delete-test.js b/tests/integration/deposits/item/delete-test.js index c7e60e3b..a19eba38 100644 --- a/tests/integration/deposits/item/delete-test.js +++ b/tests/integration/deposits/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/item/get-test.js b/tests/integration/deposits/item/get-test.js index c398283c..4e5d5d4b 100644 --- a/tests/integration/deposits/item/get-test.js +++ b/tests/integration/deposits/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/item/options-test.js b/tests/integration/deposits/item/options-test.js index 21ca75e4..f8658502 100644 --- a/tests/integration/deposits/item/options-test.js +++ b/tests/integration/deposits/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/item/patch-test.js b/tests/integration/deposits/item/patch-test.js index 797a5235..04194ea5 100644 --- a/tests/integration/deposits/item/patch-test.js +++ b/tests/integration/deposits/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/item/post-test.js b/tests/integration/deposits/item/post-test.js index cd3ea286..a54ef6a4 100644 --- a/tests/integration/deposits/item/post-test.js +++ b/tests/integration/deposits/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/options-test.js b/tests/integration/deposits/options-test.js index 36ff9c2b..7da517df 100644 --- a/tests/integration/deposits/options-test.js +++ b/tests/integration/deposits/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/patch-test.js b/tests/integration/deposits/patch-test.js index 722c2e00..b819e8d7 100644 --- a/tests/integration/deposits/patch-test.js +++ b/tests/integration/deposits/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/deposits/post-test.js b/tests/integration/deposits/post-test.js index 58c0bbfc..a88508a8 100644 --- a/tests/integration/deposits/post-test.js +++ b/tests/integration/deposits/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/delete-test.js b/tests/integration/employers/delete-test.js index 4975ab73..66a03af7 100644 --- a/tests/integration/employers/delete-test.js +++ b/tests/integration/employers/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/get-test.js b/tests/integration/employers/get-test.js index 9a9d08ba..c18ecfdd 100644 --- a/tests/integration/employers/get-test.js +++ b/tests/integration/employers/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/item/delete-test.js b/tests/integration/employers/item/delete-test.js index 81fa30fb..dd847936 100644 --- a/tests/integration/employers/item/delete-test.js +++ b/tests/integration/employers/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/item/get-test.js b/tests/integration/employers/item/get-test.js index 73428270..885b9659 100644 --- a/tests/integration/employers/item/get-test.js +++ b/tests/integration/employers/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/item/options-test.js b/tests/integration/employers/item/options-test.js index d529fb80..16e0aa34 100644 --- a/tests/integration/employers/item/options-test.js +++ b/tests/integration/employers/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/item/patch-test.js b/tests/integration/employers/item/patch-test.js index 25928096..dcc4c269 100644 --- a/tests/integration/employers/item/patch-test.js +++ b/tests/integration/employers/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/item/post-test.js b/tests/integration/employers/item/post-test.js index 1da401a6..e735df4c 100644 --- a/tests/integration/employers/item/post-test.js +++ b/tests/integration/employers/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/options-test.js b/tests/integration/employers/options-test.js index 0a9aeb1e..30316595 100644 --- a/tests/integration/employers/options-test.js +++ b/tests/integration/employers/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/patch-test.js b/tests/integration/employers/patch-test.js index a884778b..d41a4387 100644 --- a/tests/integration/employers/patch-test.js +++ b/tests/integration/employers/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/employers/post-test.js b/tests/integration/employers/post-test.js index f96d00a4..c90bd9c8 100644 --- a/tests/integration/employers/post-test.js +++ b/tests/integration/employers/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/delete-test.js b/tests/integration/expenses/delete-test.js index afa2568b..67271e91 100644 --- a/tests/integration/expenses/delete-test.js +++ b/tests/integration/expenses/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/get-test.js b/tests/integration/expenses/get-test.js index 69ae904c..8e58b88e 100644 --- a/tests/integration/expenses/get-test.js +++ b/tests/integration/expenses/get-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const Sequelize = require('sequelize'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import Sequelize from 'sequelize'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const Op = Sequelize.Op; const assert = chai.assert; diff --git a/tests/integration/expenses/item/delete-test.js b/tests/integration/expenses/item/delete-test.js index 80c2f630..6550f096 100644 --- a/tests/integration/expenses/item/delete-test.js +++ b/tests/integration/expenses/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/item/get-test.js b/tests/integration/expenses/item/get-test.js index df29aa25..244caf52 100644 --- a/tests/integration/expenses/item/get-test.js +++ b/tests/integration/expenses/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/item/options-test.js b/tests/integration/expenses/item/options-test.js index 4caddf63..f55c3286 100644 --- a/tests/integration/expenses/item/options-test.js +++ b/tests/integration/expenses/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/item/patch-test.js b/tests/integration/expenses/item/patch-test.js index 1a773c69..3583ad42 100644 --- a/tests/integration/expenses/item/patch-test.js +++ b/tests/integration/expenses/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/item/post-test.js b/tests/integration/expenses/item/post-test.js index 6ed118dd..8276d95a 100644 --- a/tests/integration/expenses/item/post-test.js +++ b/tests/integration/expenses/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/options-test.js b/tests/integration/expenses/options-test.js index e228fd79..f9f91cec 100644 --- a/tests/integration/expenses/options-test.js +++ b/tests/integration/expenses/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/patch-test.js b/tests/integration/expenses/patch-test.js index 5c476f0d..e5725207 100644 --- a/tests/integration/expenses/patch-test.js +++ b/tests/integration/expenses/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/expenses/post-test.js b/tests/integration/expenses/post-test.js index 3c3f553a..6111b3e9 100644 --- a/tests/integration/expenses/post-test.js +++ b/tests/integration/expenses/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/delete-test.js b/tests/integration/funds/delete-test.js index c8761d33..9cce36f6 100644 --- a/tests/integration/funds/delete-test.js +++ b/tests/integration/funds/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/get-test.js b/tests/integration/funds/get-test.js index 7c54cf5f..8f98f0ef 100644 --- a/tests/integration/funds/get-test.js +++ b/tests/integration/funds/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/item/delete-test.js b/tests/integration/funds/item/delete-test.js index 038a1b7d..1d5cf142 100644 --- a/tests/integration/funds/item/delete-test.js +++ b/tests/integration/funds/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/item/get-test.js b/tests/integration/funds/item/get-test.js index 17dd4fb0..22394974 100644 --- a/tests/integration/funds/item/get-test.js +++ b/tests/integration/funds/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/item/options-test.js b/tests/integration/funds/item/options-test.js index 6b5550d2..72b54314 100644 --- a/tests/integration/funds/item/options-test.js +++ b/tests/integration/funds/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/item/patch-test.js b/tests/integration/funds/item/patch-test.js index ad5f3c82..5f9cd6f6 100644 --- a/tests/integration/funds/item/patch-test.js +++ b/tests/integration/funds/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/item/post-test.js b/tests/integration/funds/item/post-test.js index d1f029ca..23ca55c1 100644 --- a/tests/integration/funds/item/post-test.js +++ b/tests/integration/funds/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/options-test.js b/tests/integration/funds/options-test.js index b806afe6..bea57acc 100644 --- a/tests/integration/funds/options-test.js +++ b/tests/integration/funds/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/patch-test.js b/tests/integration/funds/patch-test.js index 77f9f8fb..27e9d3e8 100644 --- a/tests/integration/funds/patch-test.js +++ b/tests/integration/funds/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/funds/post-test.js b/tests/integration/funds/post-test.js index 5aef674f..1be1e6c0 100644 --- a/tests/integration/funds/post-test.js +++ b/tests/integration/funds/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/get-test.js b/tests/integration/get-test.js index c579dfea..8a02ae5d 100644 --- a/tests/integration/get-test.js +++ b/tests/integration/get-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/delete-test.js b/tests/integration/household-members/delete-test.js index 64509615..be4c04cc 100644 --- a/tests/integration/household-members/delete-test.js +++ b/tests/integration/household-members/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/get-test.js b/tests/integration/household-members/get-test.js index 939e0fe1..367b8f0c 100644 --- a/tests/integration/household-members/get-test.js +++ b/tests/integration/household-members/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/item/delete-test.js b/tests/integration/household-members/item/delete-test.js index ebe58ccc..a839d537 100644 --- a/tests/integration/household-members/item/delete-test.js +++ b/tests/integration/household-members/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/item/get-test.js b/tests/integration/household-members/item/get-test.js index 0cc00b19..f6606674 100644 --- a/tests/integration/household-members/item/get-test.js +++ b/tests/integration/household-members/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/item/options-test.js b/tests/integration/household-members/item/options-test.js index 4bd084cd..81337263 100644 --- a/tests/integration/household-members/item/options-test.js +++ b/tests/integration/household-members/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/item/patch-test.js b/tests/integration/household-members/item/patch-test.js index 80671011..335d9a19 100644 --- a/tests/integration/household-members/item/patch-test.js +++ b/tests/integration/household-members/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/item/post-test.js b/tests/integration/household-members/item/post-test.js index 9833b272..2d0a48fc 100644 --- a/tests/integration/household-members/item/post-test.js +++ b/tests/integration/household-members/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/options-test.js b/tests/integration/household-members/options-test.js index 462140bc..6202cf71 100644 --- a/tests/integration/household-members/options-test.js +++ b/tests/integration/household-members/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/patch-test.js b/tests/integration/household-members/patch-test.js index b9b14878..3cc98793 100644 --- a/tests/integration/household-members/patch-test.js +++ b/tests/integration/household-members/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/household-members/post-test.js b/tests/integration/household-members/post-test.js index bfda0ff3..1a9f6691 100644 --- a/tests/integration/household-members/post-test.js +++ b/tests/integration/household-members/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/delete-test.js b/tests/integration/households/delete-test.js index 4aaf370b..6f6783a2 100644 --- a/tests/integration/households/delete-test.js +++ b/tests/integration/households/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/get-test.js b/tests/integration/households/get-test.js index ff5948f7..8d0580db 100644 --- a/tests/integration/households/get-test.js +++ b/tests/integration/households/get-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/item/delete-test.js b/tests/integration/households/item/delete-test.js index ab21d671..71601191 100644 --- a/tests/integration/households/item/delete-test.js +++ b/tests/integration/households/item/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/item/get-test.js b/tests/integration/households/item/get-test.js index 07f49128..0a1c9405 100644 --- a/tests/integration/households/item/get-test.js +++ b/tests/integration/households/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/item/options-test.js b/tests/integration/households/item/options-test.js index 33927875..6d05c32e 100644 --- a/tests/integration/households/item/options-test.js +++ b/tests/integration/households/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/item/patch-test.js b/tests/integration/households/item/patch-test.js index d1304609..fcf2fadc 100644 --- a/tests/integration/households/item/patch-test.js +++ b/tests/integration/households/item/patch-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/item/post-test.js b/tests/integration/households/item/post-test.js index c580a06f..144c981c 100644 --- a/tests/integration/households/item/post-test.js +++ b/tests/integration/households/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/options-test.js b/tests/integration/households/options-test.js index 033c7399..17a552d2 100644 --- a/tests/integration/households/options-test.js +++ b/tests/integration/households/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/patch-test.js b/tests/integration/households/patch-test.js index 3091e51d..38795ca9 100644 --- a/tests/integration/households/patch-test.js +++ b/tests/integration/households/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/households/post-test.js b/tests/integration/households/post-test.js index 4c137463..634d32d1 100644 --- a/tests/integration/households/post-test.js +++ b/tests/integration/households/post-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/delete-test.js b/tests/integration/incomes/delete-test.js index a52c9202..e7cf832e 100644 --- a/tests/integration/incomes/delete-test.js +++ b/tests/integration/incomes/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/get-test.js b/tests/integration/incomes/get-test.js index 732fc670..91d91775 100644 --- a/tests/integration/incomes/get-test.js +++ b/tests/integration/incomes/get-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const Sequelize = require('sequelize'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import Sequelize from 'sequelize'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const Op = Sequelize.Op; const assert = chai.assert; diff --git a/tests/integration/incomes/item/delete-test.js b/tests/integration/incomes/item/delete-test.js index ab8af403..6b334bf5 100644 --- a/tests/integration/incomes/item/delete-test.js +++ b/tests/integration/incomes/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/item/get-test.js b/tests/integration/incomes/item/get-test.js index 9f7d9bc6..502b726e 100644 --- a/tests/integration/incomes/item/get-test.js +++ b/tests/integration/incomes/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/item/options-test.js b/tests/integration/incomes/item/options-test.js index c2b2ea6a..258e2445 100644 --- a/tests/integration/incomes/item/options-test.js +++ b/tests/integration/incomes/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/item/patch-test.js b/tests/integration/incomes/item/patch-test.js index 632993e5..946cc693 100644 --- a/tests/integration/incomes/item/patch-test.js +++ b/tests/integration/incomes/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/item/post-test.js b/tests/integration/incomes/item/post-test.js index 10cb4a5a..39d36ce9 100644 --- a/tests/integration/incomes/item/post-test.js +++ b/tests/integration/incomes/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/options-test.js b/tests/integration/incomes/options-test.js index 3caa2403..9ae264cb 100644 --- a/tests/integration/incomes/options-test.js +++ b/tests/integration/incomes/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/patch-test.js b/tests/integration/incomes/patch-test.js index 99b3341c..e1d23411 100644 --- a/tests/integration/incomes/patch-test.js +++ b/tests/integration/incomes/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/incomes/post-test.js b/tests/integration/incomes/post-test.js index f9500bfc..49c52949 100644 --- a/tests/integration/incomes/post-test.js +++ b/tests/integration/incomes/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/delete-test.js b/tests/integration/loan-payments/delete-test.js index 14b30a6c..2fe2f5b3 100644 --- a/tests/integration/loan-payments/delete-test.js +++ b/tests/integration/loan-payments/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/get-test.js b/tests/integration/loan-payments/get-test.js index 220d9f67..2635dff7 100644 --- a/tests/integration/loan-payments/get-test.js +++ b/tests/integration/loan-payments/get-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/item/delete-test.js b/tests/integration/loan-payments/item/delete-test.js index 1da8c2e1..0805d356 100644 --- a/tests/integration/loan-payments/item/delete-test.js +++ b/tests/integration/loan-payments/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/item/get-test.js b/tests/integration/loan-payments/item/get-test.js index 697fda7f..815c05fa 100644 --- a/tests/integration/loan-payments/item/get-test.js +++ b/tests/integration/loan-payments/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/item/options-test.js b/tests/integration/loan-payments/item/options-test.js index 9d067ffb..3751dc9f 100644 --- a/tests/integration/loan-payments/item/options-test.js +++ b/tests/integration/loan-payments/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/item/patch-test.js b/tests/integration/loan-payments/item/patch-test.js index db000118..49f47567 100644 --- a/tests/integration/loan-payments/item/patch-test.js +++ b/tests/integration/loan-payments/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/item/post-test.js b/tests/integration/loan-payments/item/post-test.js index 91cea203..3139e530 100644 --- a/tests/integration/loan-payments/item/post-test.js +++ b/tests/integration/loan-payments/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/options-test.js b/tests/integration/loan-payments/options-test.js index 40fd905c..417f6233 100644 --- a/tests/integration/loan-payments/options-test.js +++ b/tests/integration/loan-payments/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/patch-test.js b/tests/integration/loan-payments/patch-test.js index da5ce8e7..59e4db66 100644 --- a/tests/integration/loan-payments/patch-test.js +++ b/tests/integration/loan-payments/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loan-payments/post-test.js b/tests/integration/loan-payments/post-test.js index 8bd59478..7489f991 100644 --- a/tests/integration/loan-payments/post-test.js +++ b/tests/integration/loan-payments/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/delete-test.js b/tests/integration/loans/delete-test.js index e614506a..8fb49110 100644 --- a/tests/integration/loans/delete-test.js +++ b/tests/integration/loans/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/get-test.js b/tests/integration/loans/get-test.js index 36583f8c..73968ae9 100644 --- a/tests/integration/loans/get-test.js +++ b/tests/integration/loans/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/item/delete-test.js b/tests/integration/loans/item/delete-test.js index f13c8aa1..160a648e 100644 --- a/tests/integration/loans/item/delete-test.js +++ b/tests/integration/loans/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/item/get-test.js b/tests/integration/loans/item/get-test.js index cd0dc33c..4556409c 100644 --- a/tests/integration/loans/item/get-test.js +++ b/tests/integration/loans/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/item/options-test.js b/tests/integration/loans/item/options-test.js index e013abfc..d1dad45a 100644 --- a/tests/integration/loans/item/options-test.js +++ b/tests/integration/loans/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/item/patch-test.js b/tests/integration/loans/item/patch-test.js index 199c80cc..e819ea79 100644 --- a/tests/integration/loans/item/patch-test.js +++ b/tests/integration/loans/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/item/post-test.js b/tests/integration/loans/item/post-test.js index 091ebf46..348b9df0 100644 --- a/tests/integration/loans/item/post-test.js +++ b/tests/integration/loans/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/options-test.js b/tests/integration/loans/options-test.js index 6a9a4263..2600ea0b 100644 --- a/tests/integration/loans/options-test.js +++ b/tests/integration/loans/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/patch-test.js b/tests/integration/loans/patch-test.js index be1d70c5..442d60b8 100644 --- a/tests/integration/loans/patch-test.js +++ b/tests/integration/loans/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/loans/post-test.js b/tests/integration/loans/post-test.js index cb5f227a..c732697a 100644 --- a/tests/integration/loans/post-test.js +++ b/tests/integration/loans/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/delete-test.js b/tests/integration/monthly-reports/delete-test.js index 3f7202a5..ebd87686 100644 --- a/tests/integration/monthly-reports/delete-test.js +++ b/tests/integration/monthly-reports/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/get-test.js b/tests/integration/monthly-reports/get-test.js index 461c33cc..4a78c7ce 100644 --- a/tests/integration/monthly-reports/get-test.js +++ b/tests/integration/monthly-reports/get-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/item/delete-test.js b/tests/integration/monthly-reports/item/delete-test.js index 3513082e..6a1e80fb 100644 --- a/tests/integration/monthly-reports/item/delete-test.js +++ b/tests/integration/monthly-reports/item/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/item/get-test.js b/tests/integration/monthly-reports/item/get-test.js index 8e5e3a7d..ea0e5f21 100644 --- a/tests/integration/monthly-reports/item/get-test.js +++ b/tests/integration/monthly-reports/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/item/options-test.js b/tests/integration/monthly-reports/item/options-test.js index 1ebbcd24..6ef031c4 100644 --- a/tests/integration/monthly-reports/item/options-test.js +++ b/tests/integration/monthly-reports/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/item/patch-test.js b/tests/integration/monthly-reports/item/patch-test.js index 46a955ae..e8fdf0bf 100644 --- a/tests/integration/monthly-reports/item/patch-test.js +++ b/tests/integration/monthly-reports/item/patch-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/item/post-test.js b/tests/integration/monthly-reports/item/post-test.js index d924a65d..e96f730a 100644 --- a/tests/integration/monthly-reports/item/post-test.js +++ b/tests/integration/monthly-reports/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/options-test.js b/tests/integration/monthly-reports/options-test.js index 28bdc600..aaef2e83 100644 --- a/tests/integration/monthly-reports/options-test.js +++ b/tests/integration/monthly-reports/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/patch-test.js b/tests/integration/monthly-reports/patch-test.js index bb4f2423..b9a0c0a5 100644 --- a/tests/integration/monthly-reports/patch-test.js +++ b/tests/integration/monthly-reports/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/monthly-reports/post-test.js b/tests/integration/monthly-reports/post-test.js index 756f8cba..b68308ad 100644 --- a/tests/integration/monthly-reports/post-test.js +++ b/tests/integration/monthly-reports/post-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/options-test.js b/tests/integration/options-test.js index b05abd55..749a722b 100644 --- a/tests/integration/options-test.js +++ b/tests/integration/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/patch-test.js b/tests/integration/patch-test.js index f5372f54..59dad606 100644 --- a/tests/integration/patch-test.js +++ b/tests/integration/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/post-test.js b/tests/integration/post-test.js index a203eeb2..7f7dc790 100644 --- a/tests/integration/post-test.js +++ b/tests/integration/post-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/delete-test.js b/tests/integration/subcategories/delete-test.js index 2234161d..bf5054a5 100644 --- a/tests/integration/subcategories/delete-test.js +++ b/tests/integration/subcategories/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/get-test.js b/tests/integration/subcategories/get-test.js index cef424aa..0d202f7e 100644 --- a/tests/integration/subcategories/get-test.js +++ b/tests/integration/subcategories/get-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/item/delete-test.js b/tests/integration/subcategories/item/delete-test.js index 42f47399..17c87e4c 100644 --- a/tests/integration/subcategories/item/delete-test.js +++ b/tests/integration/subcategories/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/item/get-test.js b/tests/integration/subcategories/item/get-test.js index 52416c09..d41a7d74 100644 --- a/tests/integration/subcategories/item/get-test.js +++ b/tests/integration/subcategories/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/item/options-test.js b/tests/integration/subcategories/item/options-test.js index 9bfd1109..1a9e6de7 100644 --- a/tests/integration/subcategories/item/options-test.js +++ b/tests/integration/subcategories/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/item/patch-test.js b/tests/integration/subcategories/item/patch-test.js index 25a1625b..c14957cf 100644 --- a/tests/integration/subcategories/item/patch-test.js +++ b/tests/integration/subcategories/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/item/post-test.js b/tests/integration/subcategories/item/post-test.js index b7579580..8f39881e 100644 --- a/tests/integration/subcategories/item/post-test.js +++ b/tests/integration/subcategories/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/options-test.js b/tests/integration/subcategories/options-test.js index ccd2e3bb..d2715d33 100644 --- a/tests/integration/subcategories/options-test.js +++ b/tests/integration/subcategories/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/patch-test.js b/tests/integration/subcategories/patch-test.js index cdf617d3..dbadcb88 100644 --- a/tests/integration/subcategories/patch-test.js +++ b/tests/integration/subcategories/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategories/post-test.js b/tests/integration/subcategories/post-test.js index 01f94a2d..dc768887 100644 --- a/tests/integration/subcategories/post-test.js +++ b/tests/integration/subcategories/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/delete-test.js b/tests/integration/subcategory-annual-reports/delete-test.js index 0a6ce0a8..5ca386bf 100644 --- a/tests/integration/subcategory-annual-reports/delete-test.js +++ b/tests/integration/subcategory-annual-reports/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/get-test.js b/tests/integration/subcategory-annual-reports/get-test.js index 2f964cdd..1f3d3e4c 100644 --- a/tests/integration/subcategory-annual-reports/get-test.js +++ b/tests/integration/subcategory-annual-reports/get-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const moment = require('moment'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import moment from 'moment'; +import { v4 as uuidv4 } from 'uuid'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/item/delete-test.js b/tests/integration/subcategory-annual-reports/item/delete-test.js index 4504cfe7..5d8f3d8a 100644 --- a/tests/integration/subcategory-annual-reports/item/delete-test.js +++ b/tests/integration/subcategory-annual-reports/item/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/item/get-test.js b/tests/integration/subcategory-annual-reports/item/get-test.js index 5883577f..a83f5ade 100644 --- a/tests/integration/subcategory-annual-reports/item/get-test.js +++ b/tests/integration/subcategory-annual-reports/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/item/options-test.js b/tests/integration/subcategory-annual-reports/item/options-test.js index 079730de..488f04c5 100644 --- a/tests/integration/subcategory-annual-reports/item/options-test.js +++ b/tests/integration/subcategory-annual-reports/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/item/patch-test.js b/tests/integration/subcategory-annual-reports/item/patch-test.js index 53a40724..3d4ed430 100644 --- a/tests/integration/subcategory-annual-reports/item/patch-test.js +++ b/tests/integration/subcategory-annual-reports/item/patch-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/item/post-test.js b/tests/integration/subcategory-annual-reports/item/post-test.js index 47b36439..ead6ba37 100644 --- a/tests/integration/subcategory-annual-reports/item/post-test.js +++ b/tests/integration/subcategory-annual-reports/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/options-test.js b/tests/integration/subcategory-annual-reports/options-test.js index fe068aff..59efac56 100644 --- a/tests/integration/subcategory-annual-reports/options-test.js +++ b/tests/integration/subcategory-annual-reports/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/patch-test.js b/tests/integration/subcategory-annual-reports/patch-test.js index 7b7a0264..1a4cfc86 100644 --- a/tests/integration/subcategory-annual-reports/patch-test.js +++ b/tests/integration/subcategory-annual-reports/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/subcategory-annual-reports/post-test.js b/tests/integration/subcategory-annual-reports/post-test.js index bf1c8809..6a6ceca5 100644 --- a/tests/integration/subcategory-annual-reports/post-test.js +++ b/tests/integration/subcategory-annual-reports/post-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/delete-test.js b/tests/integration/users/delete-test.js index c764c87f..33c0302d 100644 --- a/tests/integration/users/delete-test.js +++ b/tests/integration/users/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/get-test.js b/tests/integration/users/get-test.js index 9d7166cc..3756090f 100644 --- a/tests/integration/users/get-test.js +++ b/tests/integration/users/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/item/delete-test.js b/tests/integration/users/item/delete-test.js index d9e8e7d6..c6baaee0 100644 --- a/tests/integration/users/item/delete-test.js +++ b/tests/integration/users/item/delete-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/item/get-test.js b/tests/integration/users/item/get-test.js index 8193f329..a4a14d51 100644 --- a/tests/integration/users/item/get-test.js +++ b/tests/integration/users/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/item/options-test.js b/tests/integration/users/item/options-test.js index 4608a697..8672cf6f 100644 --- a/tests/integration/users/item/options-test.js +++ b/tests/integration/users/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/item/patch-test.js b/tests/integration/users/item/patch-test.js index dfb03220..17816bcf 100644 --- a/tests/integration/users/item/patch-test.js +++ b/tests/integration/users/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/item/post-test.js b/tests/integration/users/item/post-test.js index 9407b05e..d5540880 100644 --- a/tests/integration/users/item/post-test.js +++ b/tests/integration/users/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/delete-test.js b/tests/integration/users/login/delete-test.js index 0dcd7c68..4710cd43 100644 --- a/tests/integration/users/login/delete-test.js +++ b/tests/integration/users/login/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/get-test.js b/tests/integration/users/login/get-test.js index 1c7147f3..f4f022b1 100644 --- a/tests/integration/users/login/get-test.js +++ b/tests/integration/users/login/get-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/options-test.js b/tests/integration/users/login/options-test.js index 7d2035d8..bbf4eb8d 100644 --- a/tests/integration/users/login/options-test.js +++ b/tests/integration/users/login/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/patch-test.js b/tests/integration/users/login/patch-test.js index c387f893..4290246c 100644 --- a/tests/integration/users/login/patch-test.js +++ b/tests/integration/users/login/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/post-test.js b/tests/integration/users/login/post-test.js index b76c117f..1879d407 100644 --- a/tests/integration/users/login/post-test.js +++ b/tests/integration/users/login/post-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/token/delete-test.js b/tests/integration/users/login/token/delete-test.js index dc5065a1..4a71e7ea 100644 --- a/tests/integration/users/login/token/delete-test.js +++ b/tests/integration/users/login/token/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/token/get-test.js b/tests/integration/users/login/token/get-test.js index 578d9d7c..62ef3216 100644 --- a/tests/integration/users/login/token/get-test.js +++ b/tests/integration/users/login/token/get-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/token/options-test.js b/tests/integration/users/login/token/options-test.js index 17815b76..ba7e15eb 100644 --- a/tests/integration/users/login/token/options-test.js +++ b/tests/integration/users/login/token/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/token/patch-test.js b/tests/integration/users/login/token/patch-test.js index e5e36851..b8765c1e 100644 --- a/tests/integration/users/login/token/patch-test.js +++ b/tests/integration/users/login/token/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/login/token/post-test.js b/tests/integration/users/login/token/post-test.js index ffb38fef..0d52cf21 100644 --- a/tests/integration/users/login/token/post-test.js +++ b/tests/integration/users/login/token/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const jwt = require('jsonwebtoken'); -const sinon = require('sinon'); -const sampleData = require('../../../../sample-data'); -const TestHelper = require('../../../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import jwt from 'jsonwebtoken'; +import sinon from 'sinon'; +import sampleData from '../../../../sample-data/index.js'; +import TestHelper from '../../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/options-test.js b/tests/integration/users/options-test.js index be5ae36d..6f33e9f1 100644 --- a/tests/integration/users/options-test.js +++ b/tests/integration/users/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/patch-test.js b/tests/integration/users/patch-test.js index df8f590b..cb60d004 100644 --- a/tests/integration/users/patch-test.js +++ b/tests/integration/users/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/users/post-test.js b/tests/integration/users/post-test.js index 1cf4228c..77e32c24 100644 --- a/tests/integration/users/post-test.js +++ b/tests/integration/users/post-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); -const _ = require('lodash'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; +import _ from 'lodash'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/delete-test.js b/tests/integration/vendors/delete-test.js index 09ee69af..441def5a 100644 --- a/tests/integration/vendors/delete-test.js +++ b/tests/integration/vendors/delete-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/get-test.js b/tests/integration/vendors/get-test.js index 85fcbe62..9aa21b66 100644 --- a/tests/integration/vendors/get-test.js +++ b/tests/integration/vendors/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/item/delete-test.js b/tests/integration/vendors/item/delete-test.js index 163cb611..58ff1410 100644 --- a/tests/integration/vendors/item/delete-test.js +++ b/tests/integration/vendors/item/delete-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/item/get-test.js b/tests/integration/vendors/item/get-test.js index 220ba8c3..a247e225 100644 --- a/tests/integration/vendors/item/get-test.js +++ b/tests/integration/vendors/item/get-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/item/options-test.js b/tests/integration/vendors/item/options-test.js index affab1bf..f52cb7e4 100644 --- a/tests/integration/vendors/item/options-test.js +++ b/tests/integration/vendors/item/options-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/item/patch-test.js b/tests/integration/vendors/item/patch-test.js index eb9bf93e..2a6bd05b 100644 --- a/tests/integration/vendors/item/patch-test.js +++ b/tests/integration/vendors/item/patch-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/item/post-test.js b/tests/integration/vendors/item/post-test.js index 53c48f6c..1fed1d8e 100644 --- a/tests/integration/vendors/item/post-test.js +++ b/tests/integration/vendors/item/post-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import { v4 as uuidv4 } from 'uuid'; -const TestHelper = require('../../../test-helper'); +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/options-test.js b/tests/integration/vendors/options-test.js index b969b1dd..c9cf7591 100644 --- a/tests/integration/vendors/options-test.js +++ b/tests/integration/vendors/options-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/patch-test.js b/tests/integration/vendors/patch-test.js index 51193439..db91791d 100644 --- a/tests/integration/vendors/patch-test.js +++ b/tests/integration/vendors/patch-test.js @@ -1,6 +1,6 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/integration/vendors/post-test.js b/tests/integration/vendors/post-test.js index cf3ed683..db3a8f30 100644 --- a/tests/integration/vendors/post-test.js +++ b/tests/integration/vendors/post-test.js @@ -1,9 +1,9 @@ -const chai = require('chai'); -const chaiHttp = require('chai-http'); -const sinon = require('sinon'); +import chai from 'chai'; +import chaiHttp from 'chai-http'; +import sinon from 'sinon'; -const sampleData = require('../../sample-data'); -const TestHelper = require('../../test-helper'); +import sampleData from '../../sample-data/index.js'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; const expect = chai.expect; diff --git a/tests/sample-data/attachments.js b/tests/sample-data/attachments.js index c176de31..a1952d41 100644 --- a/tests/sample-data/attachments.js +++ b/tests/sample-data/attachments.js @@ -1,4 +1,4 @@ -module.exports = { +export default { attachment1: { aws_bucket: 'LGfuHdZgHXLddeKC', aws_content_length: 22757, diff --git a/tests/sample-data/budgets.js b/tests/sample-data/budgets.js index c2ba406d..60990870 100644 --- a/tests/sample-data/budgets.js +++ b/tests/sample-data/budgets.js @@ -1,4 +1,4 @@ -module.exports = { +export default { budget1: { amount_cents: 99763, month: 11, diff --git a/tests/sample-data/categories.js b/tests/sample-data/categories.js index 2368c39e..07c8f412 100644 --- a/tests/sample-data/categories.js +++ b/tests/sample-data/categories.js @@ -1,4 +1,4 @@ -module.exports = { +export default { category1: { name: 'Roland', }, diff --git a/tests/sample-data/deposits.js b/tests/sample-data/deposits.js index cd66d1ff..1a5bb42e 100644 --- a/tests/sample-data/deposits.js +++ b/tests/sample-data/deposits.js @@ -1,4 +1,4 @@ -module.exports = { +export default { deposit1: { amount_cents: 84464, date: '2021-01-07', diff --git a/tests/sample-data/employers.js b/tests/sample-data/employers.js index f7e51444..921630d2 100644 --- a/tests/sample-data/employers.js +++ b/tests/sample-data/employers.js @@ -1,4 +1,4 @@ -module.exports = { +export default { employer1: { name: 'Marrow & Chick', }, diff --git a/tests/sample-data/expenses.js b/tests/sample-data/expenses.js index d6285cf9..b3bdb0f4 100644 --- a/tests/sample-data/expenses.js +++ b/tests/sample-data/expenses.js @@ -1,4 +1,4 @@ -module.exports = { +export default { expense1: { amount: 607.84, amount_cents: 60784, diff --git a/tests/sample-data/funds.js b/tests/sample-data/funds.js index 671377b3..9aed18d1 100644 --- a/tests/sample-data/funds.js +++ b/tests/sample-data/funds.js @@ -1,4 +1,4 @@ -module.exports = { +export default { fund1: { name: 'Courtney', }, diff --git a/tests/sample-data/incomes.js b/tests/sample-data/incomes.js index c014eed0..3486513f 100644 --- a/tests/sample-data/incomes.js +++ b/tests/sample-data/incomes.js @@ -1,4 +1,4 @@ -module.exports = { +export default { income1: { amount: 9210.91, amount_cents: 921091, diff --git a/tests/sample-data/index.js b/tests/sample-data/index.js index be945857..f1dca036 100644 --- a/tests/sample-data/index.js +++ b/tests/sample-data/index.js @@ -1,17 +1,17 @@ -const attachments = require('./attachments'); -const budgets = require('./budgets'); -const categories = require('./categories'); -const deposits = require('./deposits'); -const employers = require('./employers'); -const expenses = require('./expenses'); -const funds = require('./funds'); -const incomes = require('./incomes'); -const loanPayments = require('./loan-payments'); -const loans = require('./loans'); -const users = require('./users'); -const vendors = require('./vendors'); +import attachments from './attachments.js'; +import budgets from './budgets.js'; +import categories from './categories.js'; +import deposits from './deposits.js'; +import employers from './employers.js'; +import expenses from './expenses.js'; +import funds from './funds.js'; +import incomes from './incomes.js'; +import loanPayments from './loan-payments.js'; +import loans from './loans.js'; +import users from './users.js'; +import vendors from './vendors.js'; -module.exports = { +export default { attachments, budgets, categories, diff --git a/tests/sample-data/loan-payments.js b/tests/sample-data/loan-payments.js index c8e0b877..83880b39 100644 --- a/tests/sample-data/loan-payments.js +++ b/tests/sample-data/loan-payments.js @@ -1,4 +1,4 @@ -module.exports = { +export default { loanPayment1: { date: '2023-01-23', interest_amount_cents: 38271, diff --git a/tests/sample-data/loans.js b/tests/sample-data/loans.js index cda8f98a..207ade9a 100644 --- a/tests/sample-data/loans.js +++ b/tests/sample-data/loans.js @@ -1,4 +1,4 @@ -module.exports = { +export default { loan1: { amount_cents: 61239, name: 'Arlene', diff --git a/tests/sample-data/users.js b/tests/sample-data/users.js index f3bcbc49..35937b37 100644 --- a/tests/sample-data/users.js +++ b/tests/sample-data/users.js @@ -1,4 +1,4 @@ -module.exports = { +export default { user1: { email: 'LindsayRigby@example.com', firstName: 'Lindsay', diff --git a/tests/sample-data/vendors.js b/tests/sample-data/vendors.js index 031856d3..c3ada561 100644 --- a/tests/sample-data/vendors.js +++ b/tests/sample-data/vendors.js @@ -1,4 +1,4 @@ -module.exports = { +export default { vendor1: { name: 'Honey & Gin', }, diff --git a/tests/test-helper/index.js b/tests/test-helper/index.js index 43993248..5b4a52b2 100644 --- a/tests/test-helper/index.js +++ b/tests/test-helper/index.js @@ -1,7 +1,7 @@ -require('../../config'); -const App = require('../../app'); +import '../../config/index.js'; +import App from '../../app/index.js'; -class TestHelper { +export default class TestHelper { async cleanup() { /* istanbul ignore if */ if (!this.app || !this.server) { @@ -111,5 +111,3 @@ class TestHelper { }); } } - -module.exports = TestHelper; diff --git a/tests/unit/controllers/attachment-ctrl/create-attachment-test.js b/tests/unit/controllers/attachment-ctrl/create-attachment-test.js index 36a2240d..a33506d3 100644 --- a/tests/unit/controllers/attachment-ctrl/create-attachment-test.js +++ b/tests/unit/controllers/attachment-ctrl/create-attachment-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; -const { AttachmentError } = require('../../../../app/middleware/error-handler'); +import { AttachmentError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/attachment-ctrl/delete-attachment-test.js b/tests/unit/controllers/attachment-ctrl/delete-attachment-test.js index 402fcc49..f03eb51b 100644 --- a/tests/unit/controllers/attachment-ctrl/delete-attachment-test.js +++ b/tests/unit/controllers/attachment-ctrl/delete-attachment-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AttachmentError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AttachmentError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/attachment-ctrl/update-attachment-test.js b/tests/unit/controllers/attachment-ctrl/update-attachment-test.js index 649e9f86..e8879b74 100644 --- a/tests/unit/controllers/attachment-ctrl/update-attachment-test.js +++ b/tests/unit/controllers/attachment-ctrl/update-attachment-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AttachmentError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AttachmentError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/attachment-ctrl/upload-attachment-test.js b/tests/unit/controllers/attachment-ctrl/upload-attachment-test.js index 561e3567..4571edfc 100644 --- a/tests/unit/controllers/attachment-ctrl/upload-attachment-test.js +++ b/tests/unit/controllers/attachment-ctrl/upload-attachment-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const nconf = require('nconf'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AttachmentError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import nconf from 'nconf'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AttachmentError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/audit-ctrl/track-changes-test.js b/tests/unit/controllers/audit-ctrl/track-changes-test.js index 16048f8c..afe73a24 100644 --- a/tests/unit/controllers/audit-ctrl/track-changes-test.js +++ b/tests/unit/controllers/audit-ctrl/track-changes-test.js @@ -1,10 +1,10 @@ -const chai = require('chai'); -const Sequelize = require('sequelize'); -const sinon = require('sinon'); +import chai from 'chai'; +import Sequelize from 'sequelize'; +import sinon from 'sinon'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AuditError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AuditError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/audit-ctrl/track-instance-destroy-test.js b/tests/unit/controllers/audit-ctrl/track-instance-destroy-test.js index 421d30e7..6de190c8 100644 --- a/tests/unit/controllers/audit-ctrl/track-instance-destroy-test.js +++ b/tests/unit/controllers/audit-ctrl/track-instance-destroy-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const crypto = require('crypto'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AuditError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import crypto from 'crypto'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AuditError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/audit-ctrl/track-instance-update-test.js b/tests/unit/controllers/audit-ctrl/track-instance-update-test.js index 7bb6eca4..374b7e95 100644 --- a/tests/unit/controllers/audit-ctrl/track-instance-update-test.js +++ b/tests/unit/controllers/audit-ctrl/track-instance-update-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const crypto = require('crypto'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AuditError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import crypto from 'crypto'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AuditError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/audit-ctrl/track-new-instance-test.js b/tests/unit/controllers/audit-ctrl/track-new-instance-test.js index 3e055b8c..1d86f8ba 100644 --- a/tests/unit/controllers/audit-ctrl/track-new-instance-test.js +++ b/tests/unit/controllers/audit-ctrl/track-new-instance-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const crypto = require('crypto'); -const Sequelize = require('sequelize'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { AuditError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import crypto from 'crypto'; +import Sequelize from 'sequelize'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { AuditError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/budget-ctrl/create-budget-test.js b/tests/unit/controllers/budget-ctrl/create-budget-test.js index 0470b621..48b819ca 100644 --- a/tests/unit/controllers/budget-ctrl/create-budget-test.js +++ b/tests/unit/controllers/budget-ctrl/create-budget-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { BudgetError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { BudgetError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/budget-ctrl/delete-budget-test.js b/tests/unit/controllers/budget-ctrl/delete-budget-test.js index 1c731e07..583183ce 100644 --- a/tests/unit/controllers/budget-ctrl/delete-budget-test.js +++ b/tests/unit/controllers/budget-ctrl/delete-budget-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { BudgetError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { BudgetError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/budget-ctrl/update-budget-test.js b/tests/unit/controllers/budget-ctrl/update-budget-test.js index 5964befa..031a042e 100644 --- a/tests/unit/controllers/budget-ctrl/update-budget-test.js +++ b/tests/unit/controllers/budget-ctrl/update-budget-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { BudgetError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { BudgetError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/create-category-test.js b/tests/unit/controllers/category-ctrl/create-category-test.js index 908491d2..6ebae7b0 100644 --- a/tests/unit/controllers/category-ctrl/create-category-test.js +++ b/tests/unit/controllers/category-ctrl/create-category-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/create-subcategory-test.js b/tests/unit/controllers/category-ctrl/create-subcategory-test.js index fc3889ba..e84f1159 100644 --- a/tests/unit/controllers/category-ctrl/create-subcategory-test.js +++ b/tests/unit/controllers/category-ctrl/create-subcategory-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/delete-category-test.js b/tests/unit/controllers/category-ctrl/delete-category-test.js index 88efce4f..3b1cf2cd 100644 --- a/tests/unit/controllers/category-ctrl/delete-category-test.js +++ b/tests/unit/controllers/category-ctrl/delete-category-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/delete-subcategory-test.js b/tests/unit/controllers/category-ctrl/delete-subcategory-test.js index cefd1fd6..22fc8601 100644 --- a/tests/unit/controllers/category-ctrl/delete-subcategory-test.js +++ b/tests/unit/controllers/category-ctrl/delete-subcategory-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/update-category-test.js b/tests/unit/controllers/category-ctrl/update-category-test.js index 0dbf68f5..a893645d 100644 --- a/tests/unit/controllers/category-ctrl/update-category-test.js +++ b/tests/unit/controllers/category-ctrl/update-category-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/category-ctrl/update-subcategory-test.js b/tests/unit/controllers/category-ctrl/update-subcategory-test.js index f30a5d63..72061337 100644 --- a/tests/unit/controllers/category-ctrl/update-subcategory-test.js +++ b/tests/unit/controllers/category-ctrl/update-subcategory-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/employer-ctrl/create-employer-test.js b/tests/unit/controllers/employer-ctrl/create-employer-test.js index 93ab8d74..0cd3b059 100644 --- a/tests/unit/controllers/employer-ctrl/create-employer-test.js +++ b/tests/unit/controllers/employer-ctrl/create-employer-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { EmployerError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { EmployerError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/employer-ctrl/delete-employer-test.js b/tests/unit/controllers/employer-ctrl/delete-employer-test.js index ac3bc0fe..c68cc43c 100644 --- a/tests/unit/controllers/employer-ctrl/delete-employer-test.js +++ b/tests/unit/controllers/employer-ctrl/delete-employer-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { EmployerError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { EmployerError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/employer-ctrl/update-employer-test.js b/tests/unit/controllers/employer-ctrl/update-employer-test.js index 7ebbd39e..478f4808 100644 --- a/tests/unit/controllers/employer-ctrl/update-employer-test.js +++ b/tests/unit/controllers/employer-ctrl/update-employer-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { EmployerError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { EmployerError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/expense-ctrl/create-expense-test.js b/tests/unit/controllers/expense-ctrl/create-expense-test.js index e43dfbbd..466bdd32 100644 --- a/tests/unit/controllers/expense-ctrl/create-expense-test.js +++ b/tests/unit/controllers/expense-ctrl/create-expense-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; -const { ExpenseError } = require('../../../../app/middleware/error-handler'); +import { ExpenseError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/expense-ctrl/delete-expense-test.js b/tests/unit/controllers/expense-ctrl/delete-expense-test.js index 45884bbe..1e29e8a6 100644 --- a/tests/unit/controllers/expense-ctrl/delete-expense-test.js +++ b/tests/unit/controllers/expense-ctrl/delete-expense-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { ExpenseError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { ExpenseError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/expense-ctrl/update-expense-test.js b/tests/unit/controllers/expense-ctrl/update-expense-test.js index 48c6448f..17c3f57c 100644 --- a/tests/unit/controllers/expense-ctrl/update-expense-test.js +++ b/tests/unit/controllers/expense-ctrl/update-expense-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { ExpenseError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { ExpenseError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/create-deposit-test.js b/tests/unit/controllers/fund-ctrl/create-deposit-test.js index c6ac5c60..0d2c3853 100644 --- a/tests/unit/controllers/fund-ctrl/create-deposit-test.js +++ b/tests/unit/controllers/fund-ctrl/create-deposit-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/create-fund-test.js b/tests/unit/controllers/fund-ctrl/create-fund-test.js index ceae03ab..aa77721b 100644 --- a/tests/unit/controllers/fund-ctrl/create-fund-test.js +++ b/tests/unit/controllers/fund-ctrl/create-fund-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/delete-deposit-test.js b/tests/unit/controllers/fund-ctrl/delete-deposit-test.js index 800d1bcc..329267a3 100644 --- a/tests/unit/controllers/fund-ctrl/delete-deposit-test.js +++ b/tests/unit/controllers/fund-ctrl/delete-deposit-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/delete-fund-test.js b/tests/unit/controllers/fund-ctrl/delete-fund-test.js index 00b1a0b0..e9992091 100644 --- a/tests/unit/controllers/fund-ctrl/delete-fund-test.js +++ b/tests/unit/controllers/fund-ctrl/delete-fund-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/update-deposit-test.js b/tests/unit/controllers/fund-ctrl/update-deposit-test.js index 46003012..aecf18c0 100644 --- a/tests/unit/controllers/fund-ctrl/update-deposit-test.js +++ b/tests/unit/controllers/fund-ctrl/update-deposit-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/fund-ctrl/update-fund-test.js b/tests/unit/controllers/fund-ctrl/update-fund-test.js index 1dc31366..bae53eb8 100644 --- a/tests/unit/controllers/fund-ctrl/update-fund-test.js +++ b/tests/unit/controllers/fund-ctrl/update-fund-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { FundError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { FundError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/household-ctrl/create-member-test.js b/tests/unit/controllers/household-ctrl/create-member-test.js index fd7e0d59..6a97e753 100644 --- a/tests/unit/controllers/household-ctrl/create-member-test.js +++ b/tests/unit/controllers/household-ctrl/create-member-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { HouseholdError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { HouseholdError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/household-ctrl/delete-member-test.js b/tests/unit/controllers/household-ctrl/delete-member-test.js index 2f7f5d40..ebff00cf 100644 --- a/tests/unit/controllers/household-ctrl/delete-member-test.js +++ b/tests/unit/controllers/household-ctrl/delete-member-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { HouseholdError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { HouseholdError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/household-ctrl/update-member-test.js b/tests/unit/controllers/household-ctrl/update-member-test.js index 5edea75f..23d7f41e 100644 --- a/tests/unit/controllers/household-ctrl/update-member-test.js +++ b/tests/unit/controllers/household-ctrl/update-member-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { HouseholdError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { HouseholdError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/income-ctrl/create-income-test.js b/tests/unit/controllers/income-ctrl/create-income-test.js index 2a09e1f6..c3bc7050 100644 --- a/tests/unit/controllers/income-ctrl/create-income-test.js +++ b/tests/unit/controllers/income-ctrl/create-income-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; -const { IncomeError } = require('../../../../app/middleware/error-handler'); +import { IncomeError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/income-ctrl/delete-income-test.js b/tests/unit/controllers/income-ctrl/delete-income-test.js index 4a393f61..01d10572 100644 --- a/tests/unit/controllers/income-ctrl/delete-income-test.js +++ b/tests/unit/controllers/income-ctrl/delete-income-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { IncomeError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { IncomeError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/income-ctrl/update-income-test.js b/tests/unit/controllers/income-ctrl/update-income-test.js index 27f24d72..d39e6f61 100644 --- a/tests/unit/controllers/income-ctrl/update-income-test.js +++ b/tests/unit/controllers/income-ctrl/update-income-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { IncomeError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { IncomeError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/create-loan-payment-test.js b/tests/unit/controllers/loan-ctrl/create-loan-payment-test.js index cf85e7e6..cac7dc3b 100644 --- a/tests/unit/controllers/loan-ctrl/create-loan-payment-test.js +++ b/tests/unit/controllers/loan-ctrl/create-loan-payment-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/create-loan-test.js b/tests/unit/controllers/loan-ctrl/create-loan-test.js index 288fcbf3..5aaded40 100644 --- a/tests/unit/controllers/loan-ctrl/create-loan-test.js +++ b/tests/unit/controllers/loan-ctrl/create-loan-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/delete-loan-payment-test.js b/tests/unit/controllers/loan-ctrl/delete-loan-payment-test.js index 8cd80d5a..3c2e558e 100644 --- a/tests/unit/controllers/loan-ctrl/delete-loan-payment-test.js +++ b/tests/unit/controllers/loan-ctrl/delete-loan-payment-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/delete-loan-test.js b/tests/unit/controllers/loan-ctrl/delete-loan-test.js index 811a24a4..042d7ee2 100644 --- a/tests/unit/controllers/loan-ctrl/delete-loan-test.js +++ b/tests/unit/controllers/loan-ctrl/delete-loan-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/update-loan-payment-test.js b/tests/unit/controllers/loan-ctrl/update-loan-payment-test.js index 67c8cdf8..8ee97785 100644 --- a/tests/unit/controllers/loan-ctrl/update-loan-payment-test.js +++ b/tests/unit/controllers/loan-ctrl/update-loan-payment-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/loan-ctrl/update-loan-test.js b/tests/unit/controllers/loan-ctrl/update-loan-test.js index ea297d35..3ad8a6e0 100644 --- a/tests/unit/controllers/loan-ctrl/update-loan-test.js +++ b/tests/unit/controllers/loan-ctrl/update-loan-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoanError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoanError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/add-user-to-household-test.js b/tests/unit/controllers/user-ctrl/add-user-to-household-test.js index c3f31ff5..5822bf05 100644 --- a/tests/unit/controllers/user-ctrl/add-user-to-household-test.js +++ b/tests/unit/controllers/user-ctrl/add-user-to-household-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const crypto = require('crypto'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import crypto from 'crypto'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { UserError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { UserError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/get-token-test.js b/tests/unit/controllers/user-ctrl/get-token-test.js index d18cf189..1233d703 100644 --- a/tests/unit/controllers/user-ctrl/get-token-test.js +++ b/tests/unit/controllers/user-ctrl/get-token-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const nconf = require('nconf'); -const jwt = require('jsonwebtoken'); -const { v4: uuidv4 } = require('uuid'); +import chai from 'chai'; +import nconf from 'nconf'; +import jwt from 'jsonwebtoken'; +import { v4 as uuidv4 } from 'uuid'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { UserError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { UserError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/login-with-password-test.js b/tests/unit/controllers/user-ctrl/login-with-password-test.js index 2d8cd617..ba4ded23 100644 --- a/tests/unit/controllers/user-ctrl/login-with-password-test.js +++ b/tests/unit/controllers/user-ctrl/login-with-password-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { LoginPasswordFailedError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { LoginPasswordFailedError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/login-with-token-test.js b/tests/unit/controllers/user-ctrl/login-with-token-test.js index 91212258..6f98ca19 100644 --- a/tests/unit/controllers/user-ctrl/login-with-token-test.js +++ b/tests/unit/controllers/user-ctrl/login-with-token-test.js @@ -1,7 +1,7 @@ -const chai = require('chai'); -const jwt = require('jsonwebtoken'); -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import jwt from 'jsonwebtoken'; +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/sign-up-test.js b/tests/unit/controllers/user-ctrl/sign-up-test.js index 95ab60b1..d8c198bb 100644 --- a/tests/unit/controllers/user-ctrl/sign-up-test.js +++ b/tests/unit/controllers/user-ctrl/sign-up-test.js @@ -1,12 +1,12 @@ -const chai = require('chai'); -const crypto = require('crypto'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import crypto from 'crypto'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { UserError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { UserError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/user-ctrl/update-user-details-test.js b/tests/unit/controllers/user-ctrl/update-user-details-test.js index ca6c9278..c7bac9b1 100644 --- a/tests/unit/controllers/user-ctrl/update-user-details-test.js +++ b/tests/unit/controllers/user-ctrl/update-user-details-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { UserError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { UserError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/vendor-ctrl/create-vendor-test.js b/tests/unit/controllers/vendor-ctrl/create-vendor-test.js index 66823b0b..15618307 100644 --- a/tests/unit/controllers/vendor-ctrl/create-vendor-test.js +++ b/tests/unit/controllers/vendor-ctrl/create-vendor-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { VendorError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { VendorError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/vendor-ctrl/delete-vendor-test.js b/tests/unit/controllers/vendor-ctrl/delete-vendor-test.js index 70c7b6c4..7b1b5f70 100644 --- a/tests/unit/controllers/vendor-ctrl/delete-vendor-test.js +++ b/tests/unit/controllers/vendor-ctrl/delete-vendor-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); - -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { VendorError } = require('../../../../app/middleware/error-handler'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; + +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { VendorError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/controllers/vendor-ctrl/update-vendor-test.js b/tests/unit/controllers/vendor-ctrl/update-vendor-test.js index 47d6796f..4a045ecf 100644 --- a/tests/unit/controllers/vendor-ctrl/update-vendor-test.js +++ b/tests/unit/controllers/vendor-ctrl/update-vendor-test.js @@ -1,11 +1,11 @@ -const chai = require('chai'); -const sinon = require('sinon'); -const { v4: uuidv4 } = require('uuid'); -const _ = require('lodash'); +import chai from 'chai'; +import sinon from 'sinon'; +import { v4 as uuidv4 } from 'uuid'; +import _ from 'lodash'; -const sampleData = require('../../../sample-data'); -const TestHelper = require('../../../test-helper'); -const { VendorError } = require('../../../../app/middleware/error-handler'); +import sampleData from '../../../sample-data/index.js'; +import TestHelper from '../../../test-helper/index.js'; +import { VendorError } from '../../../../app/middleware/error-handler/index.js'; const assert = chai.assert; diff --git a/tests/unit/middleware/error-handler/audit-error-test.js b/tests/unit/middleware/error-handler/audit-error-test.js index ac901706..72ede2b3 100644 --- a/tests/unit/middleware/error-handler/audit-error-test.js +++ b/tests/unit/middleware/error-handler/audit-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { AuditError } = require('../../../../app/middleware/error-handler'); +import { AuditError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - AuditError', function() { it('should return 500 with unknown error', function() { diff --git a/tests/unit/middleware/error-handler/category-error-test.js b/tests/unit/middleware/error-handler/category-error-test.js index 6e71c6d9..10621cf1 100644 --- a/tests/unit/middleware/error-handler/category-error-test.js +++ b/tests/unit/middleware/error-handler/category-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { CategoryError } = require('../../../../app/middleware/error-handler'); +import { CategoryError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - CategoryError', function() { it('should return cannot delete with subcategories message', function() { diff --git a/tests/unit/middleware/error-handler/expense-error-test.js b/tests/unit/middleware/error-handler/expense-error-test.js index 9f128092..118ae3ce 100644 --- a/tests/unit/middleware/error-handler/expense-error-test.js +++ b/tests/unit/middleware/error-handler/expense-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { ExpenseError } = require('../../../../app/middleware/error-handler'); +import { ExpenseError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - ExpenseError', function() { it('should return no open queries message', function() { diff --git a/tests/unit/middleware/error-handler/login-password-failed-error-test.js b/tests/unit/middleware/error-handler/login-password-failed-error-test.js index 522c833a..dc13a20c 100644 --- a/tests/unit/middleware/error-handler/login-password-failed-error-test.js +++ b/tests/unit/middleware/error-handler/login-password-failed-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { LoginPasswordFailedError } = require('../../../../app/middleware/error-handler'); +import { LoginPasswordFailedError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - LoginPasswordFailedError', function() { it('should return invalid combination even for an unknown error', function() { diff --git a/tests/unit/middleware/error-handler/user-error-test.js b/tests/unit/middleware/error-handler/user-error-test.js index 20c00105..dab1486d 100644 --- a/tests/unit/middleware/error-handler/user-error-test.js +++ b/tests/unit/middleware/error-handler/user-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { UserError } = require('../../../../app/middleware/error-handler'); +import { UserError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - UserError', function() { it('should return not found message', function() { diff --git a/tests/unit/middleware/error-handler/vendor-error-test.js b/tests/unit/middleware/error-handler/vendor-error-test.js index db7d18b6..17435adc 100644 --- a/tests/unit/middleware/error-handler/vendor-error-test.js +++ b/tests/unit/middleware/error-handler/vendor-error-test.js @@ -1,8 +1,8 @@ -const chai = require('chai'); +import chai from 'chai'; const assert = chai.assert; -const { VendorError } = require('../../../../app/middleware/error-handler'); +import { VendorError } from '../../../../app/middleware/error-handler/index.js'; describe('Unit:Middleware - ErrorHandler - VendorError', function() { it('should return not found message', function() { diff --git a/tests/unit/models/attachment-test.js b/tests/unit/models/attachment-test.js index d7fcfcc7..db466feb 100644 --- a/tests/unit/models/attachment-test.js +++ b/tests/unit/models/attachment-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/audit/api-call-test.js b/tests/unit/models/audit/api-call-test.js index c5f334c4..da135d9d 100644 --- a/tests/unit/models/audit/api-call-test.js +++ b/tests/unit/models/audit/api-call-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/audit/change-test.js b/tests/unit/models/audit/change-test.js index 36c27414..1405df64 100644 --- a/tests/unit/models/audit/change-test.js +++ b/tests/unit/models/audit/change-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/audit/log-test.js b/tests/unit/models/audit/log-test.js index 362af968..f0848e8d 100644 --- a/tests/unit/models/audit/log-test.js +++ b/tests/unit/models/audit/log-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/budget-test.js b/tests/unit/models/budget-test.js index 45288e5b..1b70a93b 100644 --- a/tests/unit/models/budget-test.js +++ b/tests/unit/models/budget-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/category-test.js b/tests/unit/models/category-test.js index a64296c7..f73c4df0 100644 --- a/tests/unit/models/category-test.js +++ b/tests/unit/models/category-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/deposit-test.js b/tests/unit/models/deposit-test.js index 96c088ad..33950dbf 100644 --- a/tests/unit/models/deposit-test.js +++ b/tests/unit/models/deposit-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/employer-test.js b/tests/unit/models/employer-test.js index 1aba400d..c82081aa 100644 --- a/tests/unit/models/employer-test.js +++ b/tests/unit/models/employer-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/expense-test.js b/tests/unit/models/expense-test.js index 13857b2c..e619a3dc 100644 --- a/tests/unit/models/expense-test.js +++ b/tests/unit/models/expense-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/fund-test.js b/tests/unit/models/fund-test.js index 3295a70c..75eb87ef 100644 --- a/tests/unit/models/fund-test.js +++ b/tests/unit/models/fund-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/hash-test.js b/tests/unit/models/hash-test.js index 5aee4c61..1bbcac00 100644 --- a/tests/unit/models/hash-test.js +++ b/tests/unit/models/hash-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/household-member-test.js b/tests/unit/models/household-member-test.js index a34919cf..3740541d 100644 --- a/tests/unit/models/household-member-test.js +++ b/tests/unit/models/household-member-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/household-test.js b/tests/unit/models/household-test.js index 579b66f9..8b604b0a 100644 --- a/tests/unit/models/household-test.js +++ b/tests/unit/models/household-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/income-test.js b/tests/unit/models/income-test.js index 169ad557..bdad3e81 100644 --- a/tests/unit/models/income-test.js +++ b/tests/unit/models/income-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/loan-payment-test.js b/tests/unit/models/loan-payment-test.js index 2482cd5f..ff738097 100644 --- a/tests/unit/models/loan-payment-test.js +++ b/tests/unit/models/loan-payment-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/loan-test.js b/tests/unit/models/loan-test.js index db49ca66..8a27f835 100644 --- a/tests/unit/models/loan-test.js +++ b/tests/unit/models/loan-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/subcategory-test.js b/tests/unit/models/subcategory-test.js index dfeda0bd..68bdbdcc 100644 --- a/tests/unit/models/subcategory-test.js +++ b/tests/unit/models/subcategory-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/user-login-test.js b/tests/unit/models/user-login-test.js index 21c7f6fb..f388a94e 100644 --- a/tests/unit/models/user-login-test.js +++ b/tests/unit/models/user-login-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/user-test.js b/tests/unit/models/user-test.js index 41a5d1b2..04a81135 100644 --- a/tests/unit/models/user-test.js +++ b/tests/unit/models/user-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert; diff --git a/tests/unit/models/vendor-test.js b/tests/unit/models/vendor-test.js index 0501031e..1fd9abcf 100644 --- a/tests/unit/models/vendor-test.js +++ b/tests/unit/models/vendor-test.js @@ -1,5 +1,5 @@ -const chai = require('chai'); -const TestHelper = require('../../test-helper'); +import chai from 'chai'; +import TestHelper from '../../test-helper/index.js'; const assert = chai.assert;