oa414
- node 8+
- npm or yarn
- Git
cd YOUR_CODE_DIR
git checkout master
npm install # or 'yarn' if your prefer
ng test
The only different of jest and master branch is value on angular.json
"projects": {
...
...
...
"architect": {
...
"test": {
"builder": "@angular-builders/jest:run" # for jest
"builder": "@angular-devkit/build-angular:karma" # for karma
cd YOUR_CODE_DIR
git checkout jest
npm install # or 'yarn' if your prefer
ng test
Chrome, Safari, Firefox
| Chrome | Safari | Firefox | |---|---|---|---| | success | success | success |
it('should get correct activeElement', () => {
const divElement = document.getElementById('editable');
divElement.focus();
expect(document.activeElement).to.equal(divElement);
});
after set focus on contenteditable element, the document.activeElement is not equal the element have focuesd.
it because jsdom have a issue with feature of document.activeElement