JS linting fixes

pull/4136/head
Thibaud Colas 2018-01-18 19:06:04 +02:00
rodzic 532a530836
commit f115ff7f4d
3 zmienionych plików z 18 dodań i 14 usunięć

Wyświetl plik

@ -8,7 +8,7 @@ describe('Document', () => {
it('works', () => {
const content = convertFromRaw({
entityMap: {
'1': {
1: {
type: 'DOCUMENT',
data: {
url: '/example.pdf',
@ -29,7 +29,7 @@ describe('Document', () => {
]
}
]
})
});
expect(shallow((
<Document
contentState={content}
@ -45,7 +45,7 @@ describe('Document', () => {
it('no data', () => {
const content = convertFromRaw({
entityMap: {
'2': {
2: {
type: 'DOCUMENT',
}
},
@ -62,7 +62,7 @@ describe('Document', () => {
]
}
]
})
});
expect(shallow((
<Document
contentState={content}

Wyświetl plik

@ -8,7 +8,7 @@ describe('Link', () => {
it('works', () => {
const content = convertFromRaw({
entityMap: {
'1': {
1: {
type: 'LINK',
data: {
url: 'http://www.example.com/',
@ -28,7 +28,7 @@ describe('Link', () => {
]
}
]
})
});
expect(shallow((
<Link
contentState={content}
@ -46,25 +46,25 @@ describe('Link', () => {
expect(getLinkAttributes({ id: '1', url: '/' })).toMatchObject({
url: '/',
label: '/',
})
});
});
it('mail', () => {
expect(getLinkAttributes({ url: 'mailto:test@ex.com' })).toMatchObject({
url: 'mailto:test@ex.com',
label: 'test@ex.com',
})
});
});
it('external', () => {
expect(getLinkAttributes({ url: 'http://www.ex.com/' })).toMatchObject({
url: 'http://www.ex.com/',
label: 'www.ex.com',
})
});
});
it('no data', () => {
expect(getLinkAttributes({})).toMatchObject({ url: '' })
expect(getLinkAttributes({})).toMatchObject({ url: '' });
});
});
});

Wyświetl plik

@ -53,14 +53,18 @@ module.exports = function exports() {
exclude: /node_modules/,
},
].concat(Object.keys(exposedDependencies).map((name) => {
const globalName = exposedDependencies[name];
// Create expose-loader configs for each Wagtail dependency.
return {
test: require.resolve(name),
use: [{
use: [
{
loader: 'expose-loader',
options: exposedDependencies[name]
}]
}
options: globalName,
},
],
};
}))
},
stats: {