Skip to content

Commit

Permalink
Improved file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
PTheocharis committed Jun 8, 2024
1 parent b2365ad commit 3e8da3f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/unit/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jest.mock('../../js&css/extension/core', () => ({
},
camelize: jest.fn((string) => {
// Mock implementation of the camelize function
// Simulate the behavior of the original camelize function
var result = '';
for (var i = 0, l = string.length; i < l; i++) {
var character = string[i];
Expand All @@ -36,8 +35,9 @@ jest.mock('../../js&css/extension/core', () => ({
}
return result;
}),
// Other mocked properties...

events: {
// Mock implementation of the events function
listeners: {},
trigger: async function (type, data) {
const listeners = this.listeners[type];
Expand All @@ -60,7 +60,7 @@ jest.mock('../../js&css/extension/core', () => ({

}));

// Mock extension object directly within the jest.mock call
// Mock extension object
const extensionMock = require('../../js&css/extension/core');

// Unit tests for the camelize function
Expand All @@ -86,9 +86,7 @@ test('Convert kebab-case to camelCase', () => {
expect(mockInput).toBe(expectedOutput);
});

// Unit test for the trigger method

// Unit tests for the trigger method
// Unit test for the events method
test('Trigger method should correctly retrieve and invoke listeners', () => {
// Mock event listeners
const listener1 = jest.fn();
Expand Down

0 comments on commit 3e8da3f

Please sign in to comment.