Skip to content
This repository has been archived by the owner on Mar 21, 2020. It is now read-only.

Commit

Permalink
Rename component to integration and drop platform label (#7)
Browse files Browse the repository at this point in the history
* Rename component to integration and drop platform label

* Fix tests
  • Loading branch information
robbiet480 authored and balloob committed Mar 20, 2019
1 parent 263b247 commit 80dbcb6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions labels/plugins/componentAndPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ const VALID_TYPES = ['component', 'platform'];
module.exports = function (payload, githubApi, files, parsed) {
return parsed
.filter(file => VALID_TYPES.includes(file.type))
.map(file => file.type === 'component' ?
`component: ${file.component}` :
`platform: ${file.component}.${file.platform}`);
.map(file => `integration: ${file.component}`);
};
14 changes: 7 additions & 7 deletions test/plugins/componentAndPlatform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ function getOutput (file) {

describe('componentAndPlatform', () => {
it('single component file', () => {
assert.deepEqual(getOutput('browser.py'), 'component: browser');
assert.deepEqual(getOutput('browser.py'), 'integration: browser');
});

it('component dir init', () => {
assert.deepEqual(getOutput('zwave/__init__.py'), 'component: zwave');
assert.deepEqual(getOutput('zwave/__init__.py'), 'integration: zwave');
});

it('component dir file', () => {
assert.deepEqual(getOutput('zwave/const.py'), 'component: zwave');
assert.deepEqual(getOutput('zwave/const.py'), 'integration: zwave');
});

it('component dir plaform file', () => {
assert.deepEqual(getOutput('zwave/light.py'), 'component: zwave');
assert.deepEqual(getOutput('zwave/light.py'), 'integration: zwave');
});

it('platform file', () => {
assert.deepEqual(getOutput('hue/light.py'), 'component: hue');
assert.deepEqual(getOutput('hue/light.py'), 'integration: hue');
});

it('platform dir', () => {
assert.deepEqual(getOutput('lifx/light/const.py'), 'component: lifx');
assert.deepEqual(getOutput('lifx/light/const.py'), 'integration: lifx');
});

it('component services', () => {
Expand All @@ -43,6 +43,6 @@ describe('componentAndPlatform', () => {
});

it('component init file', () => {
assert.deepEqual(getOutput('cover/__init__.py'), 'component: cover');
assert.deepEqual(getOutput('cover/__init__.py'), 'integration: cover');
})
});
4 changes: 2 additions & 2 deletions test/process.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ describe('process', () => {
}, null, files);
result.sort();
assert.deepEqual(result, [
'component: hue',
'component: mqtt',
'core',
'integration: hue',
'integration: mqtt',
'merging-to-master',
]);
});
Expand Down

0 comments on commit 80dbcb6

Please sign in to comment.