Skip to content

Commit

Permalink
fix: label doc/api/webcrypto.md as crypto doc
Browse files Browse the repository at this point in the history
  • Loading branch information
panva authored and phillipj committed Feb 5, 2021
1 parent c9561f4 commit 37a9a63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/node-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ const exclusiveLabelsMap = new Map([

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

// specific map for webcrypto.md as it should be labeled 'crypto'
[/^doc\/api\/webcrypto.md$/, ['doc', 'crypto']],
// specific map for modules.md as it should be labeled 'module' not 'modules'
[/^doc\/api\/modules.md$/, ['doc', 'module']],
// specific map for esm.md as it should be labeled 'ES Modules' not 'esm'
Expand Down
10 changes: 10 additions & 0 deletions test/unit/node-labels.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ tap.test('label: "doc" when only ./doc/ files has been changed', (t) => {
t.end()
})

tap.test('label: "doc" and "crypto" when webcrypto docs have been changed', (t) => {
const labels = nodeLabels.resolveLabels([
'doc/api/webcrypto.md'
])

t.same(labels, ['doc', 'crypto'])

t.end()
})

tap.test('label: "doc" & "deprecations" when ./doc/api/deprecations.md has been changed', (t) => {
const labels = nodeLabels.resolveLabels([
'doc/api/deprecations.md'
Expand Down

0 comments on commit 37a9a63

Please sign in to comment.