-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #952 from gbengaoluwadahunsi/pathJS-testFunctions
Test functions and automated git workflows testing for PathJS
- Loading branch information
Showing
3 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
let Path; | ||
if (typeof Path2D === 'function' || typeof Path2D === 'object') { | ||
Path = Path2D; | ||
} else { | ||
// Define a mock implementation for the Path object | ||
Path = function() { | ||
this.components = []; | ||
}; | ||
Path.prototype.contains = jest.fn(); | ||
Path.prototype.stroke = jest.fn(); | ||
Path.prototype.fill = jest.fn(); | ||
Path.prototype.strokeAndFill = jest.fn(); | ||
} | ||
|
||
describe('Path', () => { | ||
it('should contain a contains method', () => { | ||
const path = new Path(); | ||
expect(typeof path.contains).toBe('function'); | ||
}); | ||
|
||
it('should contain a stroke method', () => { | ||
const path = new Path(); | ||
expect(typeof path.stroke).toBe('function'); | ||
}); | ||
|
||
it('should contain a fill method', () => { | ||
const path = new Path(); | ||
expect(typeof path.fill).toBe('function'); | ||
}); | ||
|
||
it('should contain a strokeAndFill method', () => { | ||
const path = new Path(); | ||
expect(typeof path.strokeAndFill).toBe('function'); | ||
}); | ||
}); |