Created
March 25, 2023 18:12
-
-
Save kalwalt/fad9f879887a265583dfb8c51fa7ca14 to your computer and use it in GitHub Desktop.
Failing jest test for WebARKitCV class.
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
/** | |
* @jest-environment jsdom | |
*/ | |
import {describe, expect, test} from '@jest/globals'; | |
import { WebARKitCV } from '../src/WebARKitCV'; | |
describe('Init WebARKitCV and test the properties', () => { | |
test('Init the constructor...', () => { | |
document.body.innerHTML = '<img src="pinball.jpg" id="pinball" />'; | |
const wb = new WebARKitCV() | |
.setHeight(480) | |
.setWidth(640) | |
.addTrackable("pinball", "./pinball.jpg") | |
.loadTrackables() | |
.build(); | |
expect(wb.height).toBe(480); | |
expect(wb.width).toBe(640); | |
expect(wb!.trackable!.name).toBe("pinball"); | |
expect(wb!.trackable!.url).toBe("./pinball.jpg"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment