Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update deps #229

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nise (偽)
# nise (偽)

fake XHR and Server

Expand Down Expand Up @@ -219,7 +219,7 @@ This function also calls `useFakeXMLHttpRequest()`.

#### `var server = fakeServerWithClock.create();`

Creates a server that also manages fake timers.
Creates a server that also manages [fake timers](https://github.com/sinonjs/fake-timers).

This is useful when testing `XHR` objects created with e.g. jQuery 1.3.x, which uses a timer to poll the object for completion, rather than the usual `onreadystatechange`.

Expand Down
6 changes: 6 additions & 0 deletions lib/fake-server/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should accept 'autoRespond' setting",
);
});

it("allows the 'autoRespondAfter' setting", function () {
var server = sinonFakeServer.create({
autoRespondAfter: 500,
Expand All @@ -63,6 +64,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should accept 'autoRespondAfter' setting",
);
});

it("allows the 'respondImmediately' setting", function () {
var server = sinonFakeServer.create({
respondImmediately: true,
Expand All @@ -72,6 +74,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should accept 'respondImmediately' setting",
);
});

it("allows the 'fakeHTTPMethods' setting", function () {
var server = sinonFakeServer.create({
fakeHTTPMethods: true,
Expand All @@ -81,6 +84,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should accept 'fakeHTTPMethods' setting",
);
});

it("allows the 'unsafeHeadersEnabled' setting", function () {
var server = sinon.fakeServer.create({
unsafeHeadersEnabled: false,
Expand All @@ -94,6 +98,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should accept 'unsafeHeadersEnabled' setting",
);
});

it("does not assign a non-allowlisted setting", function () {
var server = sinonFakeServer.create({
foo: true,
Expand All @@ -103,6 +108,7 @@ describe("sinonFakeServer", function () {
"fakeServer.create should not accept 'foo' settings",
);
});

it("allows the 'legacyRoutes' setting", function () {
var server = sinonFakeServer.create({
legacyRoutes: false,
Expand Down
4 changes: 4 additions & 0 deletions lib/fake-xhr/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,7 @@ describe("FakeXMLHttpRequest", function () {

describe("stub XHR", function () {
beforeEach(fakeXhrSetUp);

afterEach(fakeXhrTearDown);

it("returns FakeXMLHttpRequest constructor", function () {
Expand Down Expand Up @@ -2323,6 +2324,7 @@ describe("FakeXMLHttpRequest", function () {
if (typeof ActiveXObject === "undefined") {
describe("missing ActiveXObject", function () {
beforeEach(fakeXhrSetUp);

afterEach(fakeXhrTearDown);

it("does not expose ActiveXObject", function () {
Expand All @@ -2338,6 +2340,7 @@ describe("FakeXMLHttpRequest", function () {
} else {
describe("native ActiveXObject", function () {
beforeEach(fakeXhrSetUp);

afterEach(fakeXhrTearDown);

it("hijacks ActiveXObject", function () {
Expand Down Expand Up @@ -2412,6 +2415,7 @@ describe("FakeXMLHttpRequest", function () {

describe("with native XHR", function () {
beforeEach(fakeXhrSetUp);

afterEach(fakeXhrTearDown);

it("replaces global XMLHttpRequest", function () {
Expand Down
Loading
Loading