Skip to content

Commit 5dbc9b8

Browse files
mscdexphillipj
authored andcommitted
labels: add labels for n-api (#133)
1 parent 76300a7 commit 5dbc9b8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/node-labels.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const subSystemLabelsMap = new Map([
2929
[/^src\/.*win32.*/, ['c++', 'windows']],
3030
[/^src\/node_zlib/, ['c++', 'zlib']],
3131
[/^src\/tracing/, ['c++', 'tracing']],
32+
[/^src\/node_api/, ['c++', 'n-api']],
3233

3334
// don't label python files as c++
3435
[/^src\/.+\.py$/, 'lib / src'],
@@ -107,6 +108,7 @@ const exclusiveLabelsMap = new Map([
107108
[/^test\/cctest\/test_inspector/, ['test', 'inspector', 'dont-land-on-v4.x']],
108109
[/^test\/cctest\/test_url/, ['test', 'url-whatwg',
109110
'dont-land-on-v4.x', 'dont-land-on-v6.x']],
111+
[/^test\/addons-napi\//, ['test', 'n-api']],
110112

111113
[/^test\//, 'test'],
112114

test/unit/node-labels.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,21 @@ for (const info of specificTools) {
530530
})
531531
}
532532
}
533+
534+
[
535+
[ ['c++', 'n-api'],
536+
['src/node_api.cc', 'src/node_api.h', 'src/node_api_types.h'] ],
537+
[ ['test', 'n-api'], ['test/addons-napi/foo'] ]
538+
].forEach((info) => {
539+
const labels = info[0]
540+
const files = info[1]
541+
for (const file of files) {
542+
tap.test(`label: "${labels.join('","')}" when ./${file} has been changed`, (t) => {
543+
const resolved = nodeLabels.resolveLabels([file])
544+
545+
t.same(resolved, labels)
546+
547+
t.end()
548+
})
549+
}
550+
})

0 commit comments

Comments
 (0)