Skip to content

Commit

Permalink
feat(ember)!: Upgrade to ember octane (#415)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: @pollyjs dependencies have been moved to peer dependencies
  • Loading branch information
offirgolan authored Nov 27, 2021
1 parent 297e4f5 commit 8559ef8
Show file tree
Hide file tree
Showing 143 changed files with 5,135 additions and 3,370 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-env node */

module.exports = {
root: true,
parserOptions: {
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
singleQuote: true,
trailingComma: 'none'
};
3 changes: 0 additions & 3 deletions .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
node_js:
- '12'
- '16'

addons:
chrome: stable
Expand Down
4 changes: 2 additions & 2 deletions examples/client-server/tests/events.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* global setupPolly */

describe('Events', function() {
describe('Events', function () {
setupPolly({
adapters: ['fetch'],
persister: 'local-storage'
});

it('can help test dynamic data', async function() {
it('can help test dynamic data', async function () {
const { server } = this.polly;
let numPosts = 0;

Expand Down
8 changes: 4 additions & 4 deletions examples/client-server/tests/intercept.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* global setupPolly */

describe('Intercept', function() {
describe('Intercept', function () {
setupPolly({
adapters: ['fetch'],
persister: 'local-storage'
});

it('can mock valid responses', async function() {
it('can mock valid responses', async function () {
const { server } = this.polly;

server
Expand All @@ -26,7 +26,7 @@ describe('Intercept', function() {
expect(post.title).to.equal('Post 42');
});

it('can mock invalid responses', async function() {
it('can mock invalid responses', async function () {
const { server } = this.polly;

server
Expand All @@ -42,7 +42,7 @@ describe('Intercept', function() {
expect(text).to.equal('Post not found.');
});

it('can conditionally intercept requests', async function() {
it('can conditionally intercept requests', async function () {
const { server } = this.polly;

server
Expand Down
10 changes: 5 additions & 5 deletions examples/dummy-app/src/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
SimpleShowLayout
} from 'react-admin';

const PostFilter = props => (
const PostFilter = (props) => (
<Filter {...props}>
<TextInput label="Search" source="q" alwaysOn />
<ReferenceInput label="User" source="userId" reference="users" allowEmpty>
Expand All @@ -39,7 +39,7 @@ PostTitle.propTypes = {
})
};

export const PostList = props => (
export const PostList = (props) => (
<List
title="Posts"
{...props}
Expand All @@ -63,7 +63,7 @@ export const PostList = props => (
</List>
);

export const PostShow = props => (
export const PostShow = (props) => (
<Show title={<PostTitle />} {...props}>
<SimpleShowLayout>
<TextField source="id" />
Expand All @@ -81,7 +81,7 @@ export const PostShow = props => (
</Show>
);

export const PostEdit = props => (
export const PostEdit = (props) => (
<Edit title={<PostTitle />} {...props}>
<SimpleForm>
<DisabledInput source="id" />
Expand All @@ -99,7 +99,7 @@ export const PostEdit = props => (
</Edit>
);

export const PostCreate = props => (
export const PostCreate = (props) => (
<Create {...props}>
<SimpleForm>
<TextInput source="title" />
Expand Down
10 changes: 5 additions & 5 deletions examples/dummy-app/src/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
Filter
} from 'react-admin';

const TodoFilter = props => (
const TodoFilter = (props) => (
<Filter {...props}>
<TextInput label="Search" source="q" alwaysOn />
<ReferenceInput label="User" source="userId" reference="users" allowEmpty>
Expand All @@ -40,7 +40,7 @@ TodoTitle.propTypes = {
})
};

export const TodoList = props => (
export const TodoList = (props) => (
<List
title="Todos"
{...props}
Expand All @@ -64,7 +64,7 @@ export const TodoList = props => (
</List>
);

export const TodoShow = props => (
export const TodoShow = (props) => (
<Show title={<TodoTitle />} {...props}>
<SimpleShowLayout>
<TextField source="id" />
Expand All @@ -82,7 +82,7 @@ export const TodoShow = props => (
</Show>
);

export const TodoEdit = props => (
export const TodoEdit = (props) => (
<Edit title={<TodoTitle />} {...props}>
<SimpleForm>
<DisabledInput source="id" />
Expand All @@ -100,7 +100,7 @@ export const TodoEdit = props => (
</Edit>
);

export const TodoCreate = props => (
export const TodoCreate = (props) => (
<Create {...props}>
<SimpleForm>
<TextInput source="title" />
Expand Down
4 changes: 2 additions & 2 deletions examples/dummy-app/src/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UserTitle.propTypes = {
})
};

export const UserList = props => (
export const UserList = (props) => (
<List title="Users" {...props} sort={{ field: 'name', order: 'ASC' }}>
<Datagrid>
<TextField source="name" />
Expand All @@ -31,7 +31,7 @@ export const UserList = props => (
</List>
);

export const UserShow = props => (
export const UserShow = (props) => (
<Show title={<UserTitle />} {...props}>
<SimpleShowLayout>
<TextField source="id" />
Expand Down
2 changes: 1 addition & 1 deletion examples/jest-node-fetch/src/posts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fetch = require('node-fetch');

module.exports = async id => {
module.exports = async (id) => {
const response = await fetch(
`https://jsonplaceholder.typicode.com/posts/${id}`
);
Expand Down
2 changes: 1 addition & 1 deletion examples/jest-node-fetch/src/users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fetch = require('node-fetch');

module.exports = async id => {
module.exports = async (id) => {
const response = await fetch(
`https://jsonplaceholder.typicode.com/users/${id}`
);
Expand Down
4 changes: 2 additions & 2 deletions examples/jest-puppeteer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
globals: {
page: true,
browser: true,
jestPuppeteer: true,
jestPuppeteer: true
}
}
};
4 changes: 2 additions & 2 deletions examples/node-fetch/tests/node-fetch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { expect } = require('chai');
Polly.register(NodeHttpAdapter);
Polly.register(FSPersister);

describe('node-fetch', function() {
describe('node-fetch', function () {
setupPolly({
adapters: ['node-http'],
persister: 'fs',
Expand All @@ -20,7 +20,7 @@ describe('node-fetch', function() {
}
});

it('should work', async function() {
it('should work', async function () {
const res = await fetch('https://jsonplaceholder.typicode.com/posts/1');
const post = await res.json();

Expand Down
4 changes: 2 additions & 2 deletions examples/rest-persister/tests/rest-persister.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* global setupPolly */

describe('REST Persister', function() {
describe('REST Persister', function () {
setupPolly({
adapters: ['fetch'],
persister: 'rest'
});

it('should work', async function() {
it('should work', async function () {
const res = await fetch('https://jsonplaceholder.typicode.com/posts/1');
const post = await res.json();

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
"contributor-faces": "^1.1.0",
"deepmerge": "^3.2.0",
"docsify-cli": "^4.4.3",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.2",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.1",
"formdata-polyfill": "^4.0.10",
"gh-pages": "^2.0.1",
"har-validator": "^5.1.3",
Expand All @@ -99,7 +99,7 @@
"lint-staged": "^8.2.0",
"mocha": "^6.1.4",
"npm-run-all": "^4.1.5",
"prettier": "~1.18.2",
"prettier": "^2.5.0",
"rimraf": "^3.0.2",
"rollup": "^1.14.6",
"rollup-plugin-alias": "^1.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/@pollyjs/adapter-fetch/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class FetchAdapter extends Adapter {
);
}

['fetch', 'Request', 'Response', 'Headers'].forEach(key =>
['fetch', 'Request', 'Response', 'Headers'].forEach((key) =>
this.assert(`${key} global not found.`, !!(context && context[key]))
);
this.assert(
Expand Down
Loading

0 comments on commit 8559ef8

Please sign in to comment.