Skip to content

Commit f3746b3

Browse files
committed
feat: handle generic .travis.yml
1 parent b34992c commit f3746b3

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

lib/travis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ internals.scan = (travisYaml) => {
4848
}
4949
}
5050

51-
if (!raw.size) {
51+
if (travisYaml.language === 'node_js' && !raw.size) {
5252
raw.add('latest');
5353
}
5454

test/fixtures/_no-node.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
language: generic

test/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ describe('node-support', () => {
107107
});
108108
});
109109

110+
it('returns empty array when no node detected', async () => {
111+
112+
const path = internals.prepareFixture('_no-node.yml');
113+
114+
const result = await NodeSupport.detect({ path });
115+
116+
expect(result).to.equal({
117+
name: 'test-module',
118+
version: '0.0.0-development',
119+
travis: {
120+
raw: []
121+
}
122+
});
123+
});
124+
110125
it('returns node versions from matrix env vars (NODEJS_VER)', async () => {
111126

112127
const path = internals.prepareFixture('kangax-html-minifier.yml');

0 commit comments

Comments
 (0)