Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Node < 10 support; Upgrade ember-cli-babel to ^7.0.0. #295

Merged
merged 1 commit into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"
- "10"

sudo: false
dist: trusty
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
"index.js"
],
"engines": {
"node": "6.* || 8.* || >= 10.*"
"node": ">= 10.*"
},
"author": "Taras Mankovski <[email protected]>",
"license": "MIT",
"devDependencies": {
"ember-cli": "~3.9.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^3.1.0",
"ember-cli-htmlbars-inline-precompile": "^2.0.0",
"ember-cli-htmlbars": "^5.3.1",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-qunit": "^4.3.2",
"ember-cli-shims": "^1.2.0",
Expand All @@ -38,7 +37,7 @@
"ember-load-initializers": "^2.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^5.2.0",
"ember-source": "~3.11.1",
"ember-source": "3.21.1",
"ember-source-channel-url": "^1.0.1",
"ember-try": "^1.2.1",
"eslint": "^5.16.0",
Expand All @@ -50,7 +49,7 @@
"ember-addon"
],
"dependencies": {
"ember-cli-babel": "^6.12.0",
"ember-cli-babel": "^7.0.0",
"git-repo-info": "^2.1.0"
},
"ember-addon": {
Expand Down
70 changes: 36 additions & 34 deletions tests/integration/helpers/app-version-test.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,56 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

moduleForComponent('Integration | Helper | {{app-version}}', {
integration: true
});
module('Integration | Helper | {{app-version}}', function(hooks) {
setupRenderingTest(hooks);

test('it displays entire version', function(assert) {
assert.expect(1);
test('it displays entire version', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version}}`);
await render(hbs`{{app-version}}`);

assert.ok(this.$().text(), 'Version not empty');
});
assert.ok(this.$().text(), 'Version not empty');
});

test('it displays only app version (backwards compatible)', function(assert) {
assert.expect(1);
test('it displays only app version (backwards compatible)', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version hideSha=true}}`);
await render(hbs`{{app-version hideSha=true}}`);

assert.ok(this.$().text(), 'Version not empty');
});
assert.ok(this.$().text(), 'Version not empty');
});

test('it displays only app version', function(assert) {
assert.expect(1);
test('it displays only app version', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version versionOnly=true}}`);
await render(hbs`{{app-version versionOnly=true}}`);

assert.ok(this.$().text(), 'Version not empty');
});
assert.ok(this.$().text(), 'Version not empty');
});

test('it displays only app version extended', function(assert) {
assert.expect(1);
test('it displays only app version extended', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version versionOnly=true showExtended=true}}`);
await render(hbs`{{app-version versionOnly=true showExtended=true}}`);

assert.ok(this.$().text(), 'Version not empty');
});
assert.ok(this.$().text(), 'Version not empty');
});

test('it displays only git sha (backwards compatible)', function(assert) {
assert.expect(1);
test('it displays only git sha (backwards compatible)', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version hideVersion=true}}`);
await render(hbs`{{app-version hideVersion=true}}`);

assert.ok(this.$().text(), 'Version not empty');
});
assert.ok(this.$().text(), 'Version not empty');
});

test('it displays only git sha', function(assert) {
assert.expect(1);
test('it displays only git sha', async function(assert) {
assert.expect(1);

this.render(hbs`{{app-version shaOnly=true}}`);
await render(hbs`{{app-version shaOnly=true}}`);

assert.ok(this.$().text(), 'Version not empty');
assert.ok(this.$().text(), 'Version not empty');
});
});
88 changes: 44 additions & 44 deletions tests/unit/helpers/app-version-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,69 @@ const versionString = versionOnlyString+'-'+extendedTagOnlyString+'+'+shaOnlyStr
const standardVersionString = versionOnlyString+'+'+shaOnlyString;
const oldVersion = config.APP.version;

module('Unit | Helper | app version', {
afterEach() {
module('Unit | Helper | app version', function(hooks) {
hooks.afterEach(function() {
config.APP.version = oldVersion;
}
});
});

test('it returns app version', function(assert) {
assert.expect(1);
config.APP.version = versionString;
test('it returns app version', function(assert) {
assert.expect(1);
config.APP.version = versionString;

assert.equal(appVersion(), versionString, 'Returns app version.');
});
assert.equal(appVersion(), versionString, 'Returns app version.');
});

test('it returns only app version (backwards compatible)', function(assert) {
assert.expect(1);
test('it returns only app version (backwards compatible)', function(assert) {
assert.expect(1);

config.APP.version = versionString;
let result = appVersion([], { hideSha: true });
config.APP.version = versionString;
let result = appVersion([], { hideSha: true });

assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});
assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});

test('it returns only app version', function(assert) {
assert.expect(1);
test('it returns only app version', function(assert) {
assert.expect(1);

config.APP.version = versionString;
let result = appVersion([], { versionOnly: true });
config.APP.version = versionString;
let result = appVersion([], { versionOnly: true });

assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});
assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});

test('it returns only app version extended', function(assert) {
assert.expect(1);
test('it returns only app version extended', function(assert) {
assert.expect(1);

config.APP.version = versionString;
let result = appVersion([], { versionOnly: true, showExtended: true });
config.APP.version = versionString;
let result = appVersion([], { versionOnly: true, showExtended: true });

assert.equal(result, versionOnlyString+'-'+extendedTagOnlyString, 'Returns app version extended without git sha.');
});
assert.equal(result, versionOnlyString+'-'+extendedTagOnlyString, 'Returns app version extended without git sha.');
});

test('it returns only app version (falls back when no extended)', function(assert) {
assert.expect(1);
test('it returns only app version (falls back when no extended)', function(assert) {
assert.expect(1);

config.APP.version = standardVersionString;
let result = appVersion([], { versionOnly: true, showExtended: true });
config.APP.version = standardVersionString;
let result = appVersion([], { versionOnly: true, showExtended: true });

assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});
assert.equal(result, versionOnlyString, 'Returns app version without git sha.');
});

test('it returns only git sha (backwards compatible)', function(assert) {
assert.expect(1);
test('it returns only git sha (backwards compatible)', function(assert) {
assert.expect(1);

config.APP.version = versionString;
let result = appVersion([], { hideVersion: true });
config.APP.version = versionString;
let result = appVersion([], { hideVersion: true });

assert.equal(result, shaOnlyString, 'Returns git sha without app version.');
});
assert.equal(result, shaOnlyString, 'Returns git sha without app version.');
});

test('it returns only git sha', function(assert) {
assert.expect(1);
test('it returns only git sha', function(assert) {
assert.expect(1);

config.APP.version = versionString;
let result = appVersion([], { shaOnly: true });
config.APP.version = versionString;
let result = appVersion([], { shaOnly: true });

assert.equal(result, shaOnlyString, 'Returns git sha without app version.');
assert.equal(result, shaOnlyString, 'Returns git sha without app version.');
});
});
44 changes: 22 additions & 22 deletions tests/unit/utils/regexp-test.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { module, test } from 'qunit';
import { shaRegExp, versionRegExp, versionExtendedRegExp } from 'ember-cli-app-version/utils/regexp';

module('Unit | Utility | regexp');
module('Unit | Utility | regexp', function() {
test('version reg ex matches expected strings', function(assert) {
assert.expect(4);

test('version reg ex matches expected strings', function(assert) {
assert.expect(4);
assert.ok('2.0.1'.match(versionRegExp), 'Matches expected pattern.');
assert.ok('2.20.1'.match(versionRegExp), 'Matches expected pattern.');
assert.ok(!'a.b.c'.match(versionRegExp), 'Does not match letters.');
assert.ok(!'git12sha'.match(versionRegExp), 'Does not match sha.');
});

assert.ok('2.0.1'.match(versionRegExp), 'Matches expected pattern.');
assert.ok('2.20.1'.match(versionRegExp), 'Matches expected pattern.');
assert.ok(!'a.b.c'.match(versionRegExp), 'Does not match letters.');
assert.ok(!'git12sha'.match(versionRegExp), 'Does not match sha.');
});

test('version extended reg ex matches expected strings', function(assert) {
assert.expect(4);
test('version extended reg ex matches expected strings', function(assert) {
assert.expect(4);

assert.ok('2.0.1-alpha'.match(versionExtendedRegExp), 'Matches expected pattern.');
assert.ok('2.20.1-alpha.15'.match(versionExtendedRegExp), 'Matches expected pattern.');
assert.ok(!'a.b.c-alpha.15'.match(versionExtendedRegExp), 'Does not match letters.');
assert.ok(!'git12sha'.match(versionExtendedRegExp), 'Does not match sha.');
});
assert.ok('2.0.1-alpha'.match(versionExtendedRegExp), 'Matches expected pattern.');
assert.ok('2.20.1-alpha.15'.match(versionExtendedRegExp), 'Matches expected pattern.');
assert.ok(!'a.b.c-alpha.15'.match(versionExtendedRegExp), 'Does not match letters.');
assert.ok(!'git12sha'.match(versionExtendedRegExp), 'Does not match sha.');
});

test('git sha reg ex matches expected strings', function(assert) {
assert.expect(4);
test('git sha reg ex matches expected strings', function(assert) {
assert.expect(4);

assert.ok('git12sha'.match(shaRegExp), 'Matches expected pattern.');
assert.ok(!'2.0.1'.match(shaRegExp), 'Does not match version pattern.');
assert.ok(!'2.0.1-alpha.15'.match(shaRegExp), 'Does not match version extended pattern.');
assert.ok(!'2.0.1-alphaabc.15'.match(shaRegExp), 'Does not match version extended pattern (with 8 chars in tag name).');
assert.ok('git12sha'.match(shaRegExp), 'Matches expected pattern.');
assert.ok(!'2.0.1'.match(shaRegExp), 'Does not match version pattern.');
assert.ok(!'2.0.1-alpha.15'.match(shaRegExp), 'Does not match version extended pattern.');
assert.ok(!'2.0.1-alphaabc.15'.match(shaRegExp), 'Does not match version extended pattern (with 8 chars in tag name).');
});
});
Loading