@@ -107,6 +107,26 @@ function infoForApp({
107107 } ;
108108}
109109
110+ // function info({
111+ // parent,
112+ // topLevel = parent,
113+ // version = '7.26.6',
114+ // requirement = `^${version}`,
115+ // compatible = requirement.startsWith('^7'),
116+ // dormant = false,
117+ // path = [`${parent}@${version}`],
118+ // } = {}) {
119+ // return {
120+ // parent,
121+ // topLevel,
122+ // version,
123+ // requirement,
124+ // compatible,
125+ // dormant,
126+ // path,
127+ // };
128+ // }
129+
110130QUnit . module ( 'Overrides' , function ( ) {
111131 QUnit . module ( '.addonsInfoFor' , function ( ) {
112132 // app
@@ -566,4 +586,206 @@ QUnit.module('Overrides', function () {
566586 assert . false ( overrides . hasCompatibleAddons , 'hasCompatibleAddons' ) ;
567587 assert . false ( overrides . hasDormantAddons , 'hasDormantAddons' ) ;
568588 } ) ;
589+
590+ // let project, env;
591+
592+ // function buildBabel(parent, version) {
593+ // return {
594+ // name: 'ember-cli-babel',
595+ // parent,
596+ // pkg: {
597+ // version,
598+ // },
599+ // addons: [],
600+ // };
601+ // }
602+
603+ // hooks.beforeEach(function () {
604+ // project = {
605+ // name() {
606+ // return 'fake-project';
607+ // },
608+ // pkg: {
609+ // dependencies: {},
610+ // devDependencies: {},
611+ // },
612+ // addons: [],
613+ // };
614+ // env = Object.create(null);
615+ // });
616+
617+ // hooks.afterEach(function () {});
618+
619+ // QUnit.test('when in production, does nothing', function (assert) {
620+ // env.EMBER_ENV = 'production';
621+
622+ // let result = globalDeprecationInfo(project, env);
623+
624+ // assert.deepEqual(result, {
625+ // globalMessage: '',
626+ // hasActionableSuggestions: false,
627+ // shouldIssueSingleDeprecation: false,
628+ // bootstrap: `require('@ember/-internals/bootstrap').default()`,
629+ // });
630+ // });
631+
632+ // QUnit.test('without addons, does nothing', function (assert) {
633+ // project.addons = [];
634+ // let result = globalDeprecationInfo(project, env);
635+
636+ // assert.deepEqual(result, {
637+ // globalMessage: '',
638+ // hasActionableSuggestions: false,
639+ // shouldIssueSingleDeprecation: false,
640+ // bootstrap: `require('@ember/-internals/bootstrap').default()`,
641+ // });
642+ // });
643+
644+ // QUnit.test('projects own ember-cli-babel is too old', function (assert) {
645+ // project.pkg.devDependencies = {
646+ // 'ember-cli-babel': '^7.26.0',
647+ // };
648+
649+ // project.addons.push({
650+ // name: 'ember-cli-babel',
651+ // parent: project,
652+ // pkg: {
653+ // version: '7.26.5',
654+ // },
655+ // addons: [],
656+ // });
657+
658+ // let result = globalDeprecationInfo(project, env);
659+ // assert.strictEqual(result.shouldIssueSingleDeprecation, true);
660+ // assert.strictEqual(result.hasActionableSuggestions, true);
661+ // assert.ok(
662+ // result.globalMessage.includes(
663+ // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`'
664+ // )
665+ // );
666+ // });
667+
668+ // QUnit.test('projects has ember-cli-babel in dependencies', function (assert) {
669+ // project.pkg.dependencies = {
670+ // 'ember-cli-babel': '^7.25.0',
671+ // };
672+
673+ // project.addons.push({
674+ // name: 'ember-cli-babel',
675+ // parent: project,
676+ // pkg: {
677+ // version: '7.26.5',
678+ // },
679+ // addons: [],
680+ // });
681+
682+ // let result = globalDeprecationInfo(project, env);
683+ // assert.strictEqual(result.shouldIssueSingleDeprecation, true);
684+ // assert.strictEqual(result.hasActionableSuggestions, true);
685+ // assert.ok(
686+ // result.globalMessage.includes(
687+ // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`'
688+ // )
689+ // );
690+ // });
691+ // QUnit.test(
692+ // 'projects has no devDependencies, but old ember-cli-babel found in addons array',
693+ // function (assert) {
694+ // project.pkg.devDependencies = {};
695+
696+ // project.addons.push({
697+ // name: 'ember-cli-babel',
698+ // parent: project,
699+ // pkg: {
700+ // version: '7.26.5',
701+ // },
702+ // addons: [],
703+ // });
704+
705+ // let result = globalDeprecationInfo(project, env);
706+ // assert.strictEqual(result.shouldIssueSingleDeprecation, true);
707+ // assert.strictEqual(result.hasActionableSuggestions, true);
708+ // assert.ok(
709+ // result.globalMessage.includes(
710+ // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`'
711+ // )
712+ // );
713+ // }
714+ // );
715+
716+ // QUnit.test('projects uses linked ember-cli-babel', function (assert) {
717+ // project.pkg.devDependencies = {
718+ // 'ember-cli-babel': 'link:./some/path/here',
719+ // };
720+
721+ // let otherAddon = {
722+ // name: 'other-thing-here',
723+ // parent: project,
724+ // pkg: {},
725+ // addons: [],
726+ // };
727+
728+ // otherAddon.addons.push(buildBabel(otherAddon, '7.26.5'));
729+ // project.addons.push(buildBabel(project, '7.26.6'), otherAddon);
730+
731+ // let result = globalDeprecationInfo(project, env);
732+ // assert.strictEqual(result.shouldIssueSingleDeprecation, true);
733+ // assert.strictEqual(result.hasActionableSuggestions, true);
734+
735+ // assert.ok(
736+ // result.globalMessage.includes(
737+ // '* If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel`'
738+ // )
739+ // );
740+ // assert.ok(result.globalMessage.includes('* If using npm, run `npm dedupe`'));
741+ // });
742+
743+ // QUnit.test('projects own ember-cli-babel is up to date', function (assert) {
744+ // project.pkg.devDependencies = {
745+ // 'ember-cli-babel': '^7.26.0',
746+ // };
747+
748+ // project.addons.push({
749+ // name: 'ember-cli-babel',
750+ // parent: project,
751+ // pkg: {
752+ // version: '7.26.6',
753+ // },
754+ // addons: [],
755+ // });
756+
757+ // let result = globalDeprecationInfo(project, env);
758+ // assert.strictEqual(result.shouldIssueSingleDeprecation, false);
759+ // assert.strictEqual(result.hasActionableSuggestions, false);
760+ // assert.notOk(
761+ // result.globalMessage.includes(
762+ // '* Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`'
763+ // )
764+ // );
765+ // });
766+
767+ // QUnit.test('transient babel that is out of date', function (assert) {
768+ // project.pkg.devDependencies = {
769+ // 'ember-cli-babel': '^7.26.0',
770+ // };
771+
772+ // let otherAddon = {
773+ // name: 'other-thing-here',
774+ // parent: project,
775+ // pkg: {
776+ // dependencies: {
777+ // 'ember-cli-babel': '^7.25.0',
778+ // },
779+ // },
780+ // addons: [],
781+ // };
782+
783+ // otherAddon.addons.push(buildBabel(otherAddon, '7.26.5'));
784+ // project.addons.push(buildBabel(project, '7.26.6'), otherAddon);
785+
786+ // let result = globalDeprecationInfo(project, env);
787+ // assert.strictEqual(result.shouldIssueSingleDeprecation, true);
788+ // assert.strictEqual(result.hasActionableSuggestions, true);
789+ // assert.ok(result.globalMessage.includes('* [email protected] (Compatible)')); 790+ // });
569791} ) ;
0 commit comments