forked from capricorn86/happy-dom
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
capricorn86#526@minor: Continue Fixes Problem.
- Loading branch information
Showing
2 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
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
18 changes: 8 additions & 10 deletions
18
packages/happy-dom/test/xml-http-request/XMLHttpRequest.test.ts
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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
import { XMLHttpRequest } from '../../lib/xml-http-request/xml-http-request'; | ||
import XMLHttpRequest from '../../src/xml-http-request/XMLHttpRequest'; | ||
import Window from '../../src/window/Window'; | ||
|
||
describe('XMLHttpRequest', () => { | ||
let window: Window; | ||
// @ts-ignore | ||
let xhr: XMLHttpRequest; | ||
beforeEach(() => { | ||
xhr = new XMLHttpRequest(); | ||
window = new Window(); | ||
xhr = new window.XMLHttpRequest(); | ||
}); | ||
|
||
it('XMLHttpRequest()', function () { | ||
xhr.open('GET', 'http://localhost:8080/path/to/resource/', false); | ||
xhr.addEventListener('load', () => { | ||
expect(this.status).toBe(200); | ||
expect(this.responseText).toBe('test'); | ||
expect(this.response).toBe('test'); | ||
}); | ||
xhr.send(); | ||
it('XMLHttpRequest()', () => { | ||
// TODO: Implement | ||
}); | ||
}); |