Skip to content

Commit

Permalink
labels: fix for files in internal subdirectories (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex authored and phillipj committed Jun 23, 2017
1 parent dd08aaf commit 24a7945
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const subSystemLabelsMap = new Map([
// All other lib/ files map directly
[/^lib\/_(\w+)_\w+\.js?$/, '$1'], // e.g. _(stream)_wrap
[/^lib(\/internal)?\/(\w+)\.js?$/, '$2'], // other .js files
[/^lib\/internal\/(\w+)$/, '$1'] // internal subfolders
[/^lib\/internal\/(\w+)(?:\/|$)/, '$1'] // internal subfolders
])

const jsSubsystemList = [
Expand Down
11 changes: 11 additions & 0 deletions test/unit/node-js-subsystem-labels.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,14 @@ tap.test('label: "doc,module" when doc/api/modules.md was changed', (t) => {

t.end()
})

tap.test('label: appropriate labels for files in internal subdirectories', (t) => {
const labels = nodeLabels.resolveLabels([
'lib/internal/cluster/master.js',
'lib/internal/process/next_tick.js'
], false)

t.same(labels, ['cluster', 'process'])

t.end()
})

0 comments on commit 24a7945

Please sign in to comment.