@etsoo/notificationbase 1.1.54 → 1.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@ var container = new NotificationContainerTest((update) => {});
33
33
 
34
34
  // Timer mock
35
35
  // https://jestjs.io/docs/en/timer-mocks
36
- jest.useFakeTimers();
36
+ vi.useFakeTimers();
37
37
 
38
38
  test("Tests for basic data", () => {
39
39
  expect(Object.keys(container.notifications).length).toBe(
@@ -46,13 +46,13 @@ test("Tests for notification dismiss", () => {
46
46
  const n = new NotificationTest(NotificationType.Loading, "Test");
47
47
 
48
48
  // Spy on the method
49
- const spy = jest.spyOn(n, "dismiss");
49
+ const spy = vi.spyOn(n, "dismiss");
50
50
 
51
51
  // Act
52
52
  n.dismiss(2);
53
53
 
54
54
  // Fast forward
55
- jest.runOnlyPendingTimers();
55
+ vi.runOnlyPendingTimers();
56
56
 
57
57
  // dismiss should be called 2 times
58
58
  expect(spy).toHaveBeenCalledTimes(2);
@@ -74,13 +74,13 @@ test("Tests for notification container add", () => {
74
74
  expect(n.open).toBe(false);
75
75
 
76
76
  // Fast forward
77
- jest.runOnlyPendingTimers();
77
+ vi.runOnlyPendingTimers();
78
78
 
79
79
  // Will be totally removed from the collection
80
80
  expect(container.alignCount(n.align)).toBe(0);
81
81
  });
82
82
 
83
- test("Tests for notification container remove", (done) => {
83
+ test("Tests for notification container remove", () => {
84
84
  // Arrange
85
85
  // Reset
86
86
  container.dispose();
@@ -98,7 +98,7 @@ test("Tests for notification container remove", (done) => {
98
98
  container.add(newNotification);
99
99
 
100
100
  // Fast forward
101
- jest.runOnlyPendingTimers();
101
+ vi.runOnlyPendingTimers();
102
102
 
103
103
  // Clear tests
104
104
  expect(container.alignCount(NotificationAlign.Unknown)).toBe(1);
@@ -106,8 +106,6 @@ test("Tests for notification container remove", (done) => {
106
106
  container.clear();
107
107
 
108
108
  expect(container.alignCount(NotificationAlign.Unknown)).toBe(1);
109
-
110
- done();
111
109
  };
112
110
  n.timespan = 3;
113
111
 
@@ -120,7 +118,7 @@ test("Tests for notification container remove", (done) => {
120
118
  expect(container.isModeling).toBeTruthy();
121
119
 
122
120
  // Fast forward
123
- jest.runOnlyPendingTimers();
121
+ vi.runOnlyPendingTimers();
124
122
  });
125
123
 
126
- jest.clearAllTimers();
124
+ vi.clearAllTimers();
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "Node10",
4
+ "module": "ES2020",
5
+ "moduleResolution": "bundler",
6
6
  "allowJs": false,
7
- "skipLibCheck": true,
7
+ "skipLibCheck": false,
8
8
  "esModuleInterop": true,
9
9
  "allowSyntheticDefaultImports": true,
10
10
  "strict": true,
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "isolatedModules": true,
13
13
  "noEmit": true,
14
- "declaration": true
14
+ "declaration": true,
15
+ "types": ["vitest/globals"]
15
16
  },
16
17
  "include": [".."]
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/notificationbase",
3
- "version": "1.1.54",
3
+ "version": "1.1.55",
4
4
  "description": "TypeScript notification component for extending with all features described and partially implemented",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -13,24 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
16
- "format": "prettier --write src/**/*.ts",
17
- "lint": "eslint --ext .ts src/",
18
- "test": "jest",
19
- "test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand"
20
- },
21
- "jest": {
22
- "automock": false,
23
- "testMatch": [
24
- "<rootDir>/__tests__/**/*.ts"
25
- ],
26
- "testEnvironment": "jsdom",
27
- "transform": {
28
- ".+\\.jsx?$": "babel-jest",
29
- ".+\\.tsx?$": "ts-jest"
30
- },
31
- "transformIgnorePatterns": [
32
- "/node_modules/(?!@etsoo/).+\\.js$"
33
- ]
16
+ "test": "vitest"
34
17
  },
35
18
  "repository": {
36
19
  "type": "git",
@@ -52,18 +35,16 @@
52
35
  },
53
36
  "homepage": "https://github.com/ETSOO/NotificationBase#readme",
54
37
  "dependencies": {
55
- "@etsoo/shared": "^1.2.55"
38
+ "@etsoo/shared": "^1.2.57"
56
39
  },
57
40
  "devDependencies": {
58
41
  "@babel/core": "^7.26.0",
59
42
  "@babel/plugin-transform-runtime": "^7.25.9",
60
43
  "@babel/preset-env": "^7.26.0",
61
44
  "@babel/runtime-corejs3": "^7.26.0",
62
- "@types/jest": "^29.5.14",
63
- "babel-jest": "^29.7.0",
64
- "jest": "^29.7.0",
65
- "jest-environment-jsdom": "^29.7.0",
66
- "ts-jest": "^29.2.5",
67
- "typescript": "^5.7.2"
45
+ "@vitejs/plugin-react": "^4.3.4",
46
+ "jsdom": "^26.0.0",
47
+ "typescript": "^5.7.3",
48
+ "vitest": "^2.1.8"
68
49
  }
69
50
  }
package/tsconfig.cjs.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "declaration": true,
11
11
  "strict": true,
12
12
  "esModuleInterop": true,
13
- "skipLibCheck": true,
13
+ "skipLibCheck": false,
14
14
  "forceConsistentCasingInFileNames": true
15
15
  },
16
16
  "include": ["src"]
package/tsconfig.json CHANGED
@@ -2,15 +2,15 @@
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
4
  "target": "ES2020",
5
- "module": "ESNext",
6
- "moduleResolution": "Node10",
5
+ "module": "ES2020",
6
+ "moduleResolution": "bundler",
7
7
  "isolatedModules": true,
8
8
  "outDir": "./lib/mjs",
9
9
  "noEmit": false,
10
10
  "declaration": true,
11
11
  "strict": true,
12
12
  "esModuleInterop": true,
13
- "skipLibCheck": true,
13
+ "skipLibCheck": false,
14
14
  "forceConsistentCasingInFileNames": true
15
15
  },
16
16
  "include": ["src"]
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import react from "@vitejs/plugin-react";
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ test: {
7
+ globals: true,
8
+ environment: "jsdom",
9
+ include: ["__tests__/**/*.ts(x)?"]
10
+ }
11
+ });