ui: Updates Consul blueprints to be compatible with new ED version (#7370)

This commit is contained in:
John Cowen 2020-03-02 12:45:42 -05:00 committed by John Cowen
parent 941fefb15c
commit 9063cf8ecf
9 changed files with 19 additions and 70 deletions

View file

@ -1,11 +1,10 @@
/*eslint node/no-extraneous-require: "off"*/
'use strict';
const useTestFrameworkDetector = require('@ember-data/-build-infra/src/utilities/test-framework-detector');
const path = require('path'); const path = require('path');
const testInfo = require('ember-cli-test-info');
const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
module.exports = useTestFrameworkDetector({ module.exports = useTestFrameworkDetector({
description: 'Generates a Consul HTTP ember-data adapter unit and integration tests', description: 'Generates Consul HTTP ember-data adapter unit and integration tests',
root: __dirname, root: __dirname,
@ -16,7 +15,7 @@ module.exports = useTestFrameworkDetector({
}, },
__path__() { __path__() {
return ''; return '';
} },
}; };
}, },

View file

@ -2,7 +2,6 @@
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const isModuleUnificationProject = require('@ember-data/-build-infra/src/utilities/module-unification').isModuleUnificationProject;
module.exports = { module.exports = {
description: 'Generates a Consul HTTP ember-data adapter', description: 'Generates a Consul HTTP ember-data adapter',
@ -11,19 +10,6 @@ module.exports = {
root: __dirname, root: __dirname,
fileMapTokens(options) { fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
__root__() {
return 'src';
},
__path__(options) {
return path.join('data', 'models', options.dasherizedModuleName);
},
__name__() {
return 'adapter';
},
};
}
}, },
locals(options) { locals(options) {
// Return custom template variables here. // Return custom template variables here.

View file

@ -1,11 +1,9 @@
/*eslint node/no-extraneous-require: "off"*/
'use strict';
const useTestFrameworkDetector = require('@ember-data/-build-infra/src/utilities/test-framework-detector');
const path = require('path'); const path = require('path');
const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
module.exports = useTestFrameworkDetector({ module.exports = useTestFrameworkDetector({
description: 'Generates a Consul ember-data model unit tests', description: 'Generates a Consul ember-data model unit test.',
root: __dirname, root: __dirname,
@ -16,7 +14,7 @@ module.exports = useTestFrameworkDetector({
}, },
__path__() { __path__() {
return ''; return '';
} },
}; };
}, },

View file

@ -2,7 +2,6 @@
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const isModuleUnificationProject = require('@ember-data/-build-infra/src/utilities/module-unification').isModuleUnificationProject;
module.exports = { module.exports = {
description: 'Generates a Consul HTTP ember-data model', description: 'Generates a Consul HTTP ember-data model',
@ -10,21 +9,6 @@ module.exports = {
root: __dirname, root: __dirname,
fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
__root__() {
return 'src';
},
__path__(options) {
return path.join('data', 'models', options.dasherizedModuleName);
},
__name__() {
return 'model';
},
};
}
},
locals(options) { locals(options) {
// Return custom template variables here. // Return custom template variables here.
return { return {

View file

@ -1,11 +1,9 @@
/*eslint node/no-extraneous-require: "off"*/
'use strict';
const useTestFrameworkDetector = require('@ember-data/-build-infra/src/utilities/test-framework-detector');
const path = require('path'); const path = require('path');
const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
module.exports = useTestFrameworkDetector({ module.exports = useTestFrameworkDetector({
description: 'Generates a Consul HTTP ember-data serializer unit and integration tests', description: 'Generates Consul repository unit and integration tests',
root: __dirname, root: __dirname,
@ -16,7 +14,7 @@ module.exports = useTestFrameworkDetector({
}, },
__path__() { __path__() {
return ''; return '';
} },
}; };
}, },

View file

@ -9,7 +9,7 @@ const dc = 'dc-1';
const id = 'slug'; const id = 'slug';
const now = new Date().getTime(); const now = new Date().getTime();
test('findByDatacenter returns the correct data for list endpoint', function(assert) { test('findByDatacenter returns the correct data for list endpoint', function(assert) {
get(this.subject(), 'store').serializerFor('<%= dasherizedModuleName %>').timestamp = function() { this.subject().store.serializerFor('<%= dasherizedModuleName %>').timestamp = function() {
return now; return now;
}; };
return repo( return repo(

View file

@ -6,7 +6,7 @@ module('Unit | Repository | <%= dasherizedModuleName %>', function(hooks) {
// Replace this with your real tests. // Replace this with your real tests.
test('it exists', function(assert) { test('it exists', function(assert) {
let repo = this.owner.lookup('service:repository/<%= dasherizedModuleName %>'); const repo = this.owner.lookup('service:repository/<%= dasherizedModuleName %>');
assert.ok(repo); assert.ok(repo);
}); });
}); });

View file

@ -1,11 +1,9 @@
/*eslint node/no-extraneous-require: "off"*/
'use strict';
const useTestFrameworkDetector = require('@ember-data/-build-infra/src/utilities/test-framework-detector');
const path = require('path'); const path = require('path');
const useTestFrameworkDetector = require('@ember-data/private-build-infra/src/utilities/test-framework-detector');
module.exports = useTestFrameworkDetector({ module.exports = useTestFrameworkDetector({
description: 'Generates a Consul HTTP ember-data serializer unit and integration tests', description: 'Generates Consul HTTP ember-data serializer unit and integration tests.',
root: __dirname, root: __dirname,
@ -16,7 +14,7 @@ module.exports = useTestFrameworkDetector({
}, },
__path__() { __path__() {
return ''; return '';
} },
}; };
}, },

View file

@ -2,7 +2,6 @@
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const isModuleUnificationProject = require('@ember-data/-build-infra/src/utilities/module-unification').isModuleUnificationProject;
module.exports = { module.exports = {
description: 'Generates a Consul HTTP ember-data serializer', description: 'Generates a Consul HTTP ember-data serializer',
@ -11,19 +10,6 @@ module.exports = {
root: __dirname, root: __dirname,
fileMapTokens(options) { fileMapTokens(options) {
if (isModuleUnificationProject(this.project)) {
return {
__root__() {
return 'src';
},
__path__(options) {
return path.join('data', 'models', options.dasherizedModuleName);
},
__name__() {
return 'serializer';
},
};
}
}, },
locals(options) { locals(options) {
// Return custom template variables here. // Return custom template variables here.