Skip to content

Commit c25a7fd

Browse files
Merge branch 'hotfix/require-type'
2 parents 3a8a00e + 85ad2c1 commit c25a7fd

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lint: .jshintrc
2121
$(BIN)js-yaml $< > $@
2222

2323
test: test/data/expected.stream.json dist
24-
$(BIN)_mocha test/**/*.test.js
24+
$(BIN)mocha test/**/*.test.js
2525
$(SASSDOC) --parse test/data/test.scss | diff - test/data/expected.json
2626
$(SASSDOC) --parse - < test/data/test.scss | diff - test/data/expected.stream.json
2727
rm -rf sassdoc && $(SASSDOC) test/data/test.scss && [ -d sassdoc ]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"url": "https://twitter.com/pascalduez"
2222
}
2323
],
24-
"version": "2.1.5",
24+
"version": "2.1.6",
2525
"license": {
2626
"type": "MIT",
2727
"url": "http://opensource.org/licenses/MIT"

src/annotation/annotations/require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default function (env) {
120120
return req;
121121
}
122122

123-
let reqItem = Array.find(data, x => x.context.name === req.name);
123+
let reqItem = Array.find(data, x => x.context.name === req.name && x.context.type === req.type);
124124

125125
if (reqItem === undefined) {
126126
if (!req.autofill) {

test/annotations/require.test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ describe('#require', function () {
4949

5050
it('should work for multiline description', function () {
5151
assert.deepEqual(requires.parse('name - description\nmore\nthan\none\nline'), { type: 'function', name: 'name', description: 'description\nmore\nthan\none\nline', 'external': false });
52-
});
52+
});
53+
54+
it('should resolve by type and name', function () {
55+
var data = [
56+
{ context: { type: 'function', name: 'rem' } },
57+
{ context: { type: 'mixin', name: 'rem' } },
58+
{ context: { type: 'mixin', name: 'test' }, require: [ { type: 'mixin', name: 'rem' } ] },
59+
];
60+
61+
requires.resolve(data);
62+
63+
assert.deepEqual(data[2].require[0].item.context, { type: 'mixin', name: 'rem' });
64+
});
5365

5466
});

0 commit comments

Comments
 (0)