-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style: no more semi colons! * style: disable semis for flowtype eslint plugin * fix: eslint errors
- Loading branch information
1 parent
d4be531
commit 7bf2478
Showing
428 changed files
with
6,930 additions
and
7,082 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
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
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
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
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
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
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,12 +1,12 @@ | ||
/* @flow */ | ||
|
||
import * as Adapters from './packages/adapter'; | ||
import * as Testing from './packages/testing'; | ||
import * as Adapters from './packages/adapter' | ||
import * as Testing from './packages/testing' | ||
|
||
export { Adapters, Testing }; | ||
export { Model } from './packages/database'; | ||
export { default as Logger } from './packages/logger'; | ||
export { default as Controller } from './packages/controller'; | ||
export { default as Serializer } from './packages/serializer'; | ||
export { default as Application } from './packages/application'; | ||
export { default as luxify } from './packages/luxify'; | ||
export { Adapters, Testing } | ||
export { Model } from './packages/database' | ||
export { default as Logger } from './packages/logger' | ||
export { default as Controller } from './packages/controller' | ||
export { default as Serializer } from './packages/serializer' | ||
export { default as Application } from './packages/application' | ||
export { default as luxify } from './packages/luxify' |
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,100 +1,100 @@ | ||
/* @flow */ | ||
|
||
import { MIME_TYPE } from '../../jsonapi'; | ||
import { Headers, ResponseHeaders } from '../utils/headers'; | ||
import { MIME_TYPE } from '../../jsonapi' | ||
import { Headers, ResponseHeaders } from '../utils/headers' | ||
|
||
describe('module "adapters/headers"', () => { | ||
let subject; | ||
let subject | ||
|
||
describe('util Headers', () => { | ||
beforeEach(() => { | ||
subject = new Headers(); | ||
}); | ||
subject = new Headers() | ||
}) | ||
|
||
describe('#constructor()', () => { | ||
beforeEach(() => { | ||
subject = new Headers({ | ||
Accept: MIME_TYPE, | ||
'Content-Type': MIME_TYPE, | ||
}); | ||
}); | ||
}) | ||
}) | ||
|
||
test('creates an instance of Headers', () => { | ||
expect(subject).toMatchSnapshot(); | ||
}); | ||
expect(subject).toMatchSnapshot() | ||
}) | ||
}); | ||
|
||
['get', 'has'].forEach(method => { | ||
describe(`#${method}()`, () => { | ||
const key = 'Accept'; | ||
const value = method === 'get' ? MIME_TYPE : true; | ||
const key = 'Accept' | ||
const value = method === 'get' ? MIME_TYPE : true | ||
|
||
beforeEach(() => { | ||
subject.set(key, MIME_TYPE); | ||
}); | ||
subject.set(key, MIME_TYPE) | ||
}) | ||
|
||
test('returns the correct value for the given key', () => { | ||
// $FlowIgnore | ||
expect(subject[method](key)).toBe(value); | ||
}); | ||
expect(subject[method](key)).toBe(value) | ||
}) | ||
|
||
test('is not case sensitive', () => { | ||
// $FlowIgnore | ||
expect(subject[method](key.toUpperCase())).toBe(value); | ||
}); | ||
}); | ||
}); | ||
expect(subject[method](key.toUpperCase())).toBe(value) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('#set()', () => { | ||
const key = 'Accept'; | ||
const value = MIME_TYPE; | ||
const key = 'Accept' | ||
const value = MIME_TYPE | ||
|
||
test('sets the correct value for the given key', () => { | ||
expect(subject.set(key, value)).toMatchSnapshot(); | ||
}); | ||
}); | ||
expect(subject.set(key, value)).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('#delete()', () => { | ||
const key = 'Accept'; | ||
const value = MIME_TYPE; | ||
const key = 'Accept' | ||
const value = MIME_TYPE | ||
|
||
beforeEach(() => { | ||
subject.set(key, value); | ||
}); | ||
subject.set(key, value) | ||
}) | ||
|
||
test('deletes the entry for a given key', () => { | ||
subject.delete(key); | ||
expect(subject.size).toBe(0); | ||
}); | ||
subject.delete(key) | ||
expect(subject.size).toBe(0) | ||
}) | ||
|
||
test('is not case sensitive', () => { | ||
subject.delete(key.toUpperCase()); | ||
expect(subject.size).toBe(0); | ||
}); | ||
}); | ||
}); | ||
subject.delete(key.toUpperCase()) | ||
expect(subject.size).toBe(0) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('util ResponseHeaders', () => { | ||
const key = 'Content-Type'; | ||
const value = MIME_TYPE; | ||
const handleChange = jest.fn(); | ||
const key = 'Content-Type' | ||
const value = MIME_TYPE | ||
const handleChange = jest.fn() | ||
|
||
beforeEach(() => { | ||
subject = new ResponseHeaders(handleChange); | ||
}); | ||
subject = new ResponseHeaders(handleChange) | ||
}) | ||
|
||
describe('#set()', () => { | ||
test('calls the change handler', () => { | ||
subject.set(key, value); | ||
expect(handleChange).toBeCalledWith('SET', [key, value]); | ||
}); | ||
}); | ||
subject.set(key, value) | ||
expect(handleChange).toBeCalledWith('SET', [key, value]) | ||
}) | ||
}) | ||
|
||
describe('#delete()', () => { | ||
test('calls the change handler', () => { | ||
subject.delete(key); | ||
expect(handleChange).toBeCalledWith('DELETE', [key, null]); | ||
}); | ||
}); | ||
}); | ||
}); | ||
subject.delete(key) | ||
expect(handleChange).toBeCalledWith('DELETE', [key, null]) | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.