Skip to content

Commit

Permalink
Revert unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jun 6, 2024
1 parent daf48e4 commit 55c76cb
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/adapters/SinonServer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('SinonServer', () => {
context.params.range = [start, end];
return next(request, context);
});
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('SinonServer', () => {
};
return response;
});
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand All @@ -111,7 +111,7 @@ describe('SinonServer', () => {
requestUrl = request.url;
return next(request, context);
});
server.database.addCollection('foo', new Collection());
server.addCollection('foo', new Collection());

const request = getFakeXMLHTTPRequest('GET', '/foo');
if (request == null) throw new Error('request is null');
Expand All @@ -132,7 +132,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo by sending all items in collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand All @@ -159,7 +159,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo?queryString by sending all items in collection foo satisfying query', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foos',
new Collection({
items: [
Expand All @@ -169,7 +169,7 @@ describe('SinonServer', () => {
],
}),
);
server.database.addCollection(
server.addCollection(
'bars',
new Collection({ items: [{ id: 0, name: 'a', foo_id: 1 }] }),
);
Expand All @@ -194,7 +194,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo?queryString with pagination by sending the correct content-range header', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo on an empty collection with a []', async () => {
const server = new SinonServer();
server.database.addCollection('foo', new Collection());
server.addCollection('foo', new Collection());
const request = getFakeXMLHTTPRequest('GET', '/foo');
if (request == null) throw new Error('request is null');
await server.handle(request);
Expand All @@ -247,7 +247,7 @@ describe('SinonServer', () => {

it('should respond to POST /foo by adding an item to collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand Down Expand Up @@ -300,7 +300,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo/:id by sending element of identifier id in collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand All @@ -322,7 +322,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo/:id on a non-existing id with a 404', async () => {
const server = new SinonServer();
server.database.addCollection('foo', new Collection());
server.addCollection('foo', new Collection());
const request = getFakeXMLHTTPRequest('GET', '/foo/3');
if (request == null) throw new Error('request is null');
await server.handle(request);
Expand All @@ -331,7 +331,7 @@ describe('SinonServer', () => {

it('should respond to PUT /foo/:id by updating element of identifier id in collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('SinonServer', () => {

it('should respond to PUT /foo/:id on a non-existing id with a 404', async () => {
const server = new SinonServer();
server.database.addCollection('foo', new Collection({ items: [] }));
server.addCollection('foo', new Collection({ items: [] }));
const request = getFakeXMLHTTPRequest(
'PUT',
'/foo/3',
Expand All @@ -374,7 +374,7 @@ describe('SinonServer', () => {

it('should respond to PATCH /foo/:id by updating element of identifier id in collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand Down Expand Up @@ -404,7 +404,7 @@ describe('SinonServer', () => {

it('should respond to PATCH /foo/:id on a non-existing id with a 404', async () => {
const server = new SinonServer();
server.database.addCollection('foo', new Collection({ items: [] }));
server.addCollection('foo', new Collection({ items: [] }));
const request = getFakeXMLHTTPRequest(
'PATCH',
'/foo/3',
Expand All @@ -417,7 +417,7 @@ describe('SinonServer', () => {

it('should respond to DELETE /foo/:id by removing element of identifier id in collection foo', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [
Expand All @@ -442,7 +442,7 @@ describe('SinonServer', () => {

it('should respond to DELETE /foo/:id on a non-existing id with a 404', async () => {
const server = new SinonServer();
server.database.addCollection('foo', new Collection({ items: [] }));
server.addCollection('foo', new Collection({ items: [] }));
const request = getFakeXMLHTTPRequest('DELETE', '/foo/3');
if (request == null) throw new Error('request is null');
await server.handle(request);
Expand All @@ -451,7 +451,7 @@ describe('SinonServer', () => {

it('should respond to GET /foo/ with single item', async () => {
const server = new SinonServer();
server.database.addSingle('foo', new Single({ name: 'foo' }));
server.addSingle('foo', new Single({ name: 'foo' }));

const request = getFakeXMLHTTPRequest('GET', '/foo');
if (request == null) throw new Error('request is null');
Expand All @@ -466,7 +466,7 @@ describe('SinonServer', () => {

it('should respond to PUT /foo/ by updating the singleton record', async () => {
const server = new SinonServer();
server.database.addSingle('foo', new Single({ name: 'foo' }));
server.addSingle('foo', new Single({ name: 'foo' }));

const request = getFakeXMLHTTPRequest(
'PUT',
Expand All @@ -486,7 +486,7 @@ describe('SinonServer', () => {

it('should respond to PATCH /foo/ by updating the singleton record', async () => {
const server = new SinonServer();
server.database.addSingle('foo', new Single({ name: 'foo' }));
server.addSingle('foo', new Single({ name: 'foo' }));

const request = getFakeXMLHTTPRequest(
'PATCH',
Expand All @@ -508,7 +508,7 @@ describe('SinonServer', () => {
describe('setDefaultQuery', () => {
it('should set the default query string', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
Expand All @@ -531,7 +531,7 @@ describe('SinonServer', () => {

it('should not override any provided query string', async () => {
const server = new SinonServer();
server.database.addCollection(
server.addCollection(
'foo',
new Collection({
items: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
Expand Down

0 comments on commit 55c76cb

Please sign in to comment.