Skip to content

Commit 2fcb059

Browse files
committed
service test
1 parent 7b80093 commit 2fcb059

File tree

1 file changed

+11
-202
lines changed

1 file changed

+11
-202
lines changed

node-tests/blueprints/service-test.js

Lines changed: 11 additions & 202 deletions
Original file line numberDiff line numberDiff line change
@@ -19,126 +19,6 @@ const enableOctane = setupTestEnvironment.enableOctane;
1919
describe('Blueprint: service', function () {
2020
setupTestHooks(this);
2121

22-
describe('in app', function () {
23-
beforeEach(function () {
24-
return emberNew()
25-
.then(() =>
26-
modifyPackages([
27-
{ name: 'ember-qunit', delete: true },
28-
{ name: 'ember-cli-qunit', dev: true },
29-
])
30-
)
31-
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
32-
});
33-
34-
it('service foo', function () {
35-
return emberGenerateDestroy(['service', 'foo'], (_file) => {
36-
expect(_file('app/services/foo.js')).to.equal(fixture('service/service.js'));
37-
38-
expect(_file('tests/unit/services/foo-test.js')).to.equal(
39-
fixture('service-test/default.js')
40-
);
41-
});
42-
});
43-
44-
it('service foo.js', function () {
45-
return emberGenerateDestroy(['service', 'foo.js'], (_file) => {
46-
expect(_file('app/services/foo.js.js')).to.not.exist;
47-
expect(_file('tests/unit/services/foo-test.js.js')).to.not.exist;
48-
49-
expect(_file('app/services/foo.js')).to.equal(fixture('service/service.js'));
50-
51-
expect(_file('tests/unit/services/foo-test.js')).to.equal(
52-
fixture('service-test/default.js')
53-
);
54-
});
55-
});
56-
57-
it('service foo/bar', function () {
58-
return emberGenerateDestroy(['service', 'foo/bar'], (_file) => {
59-
expect(_file('app/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
60-
61-
expect(_file('tests/unit/services/foo/bar-test.js')).to.equal(
62-
fixture('service-test/default-nested.js')
63-
);
64-
});
65-
});
66-
67-
it('service foo --pod', function () {
68-
return emberGenerateDestroy(['service', 'foo', '--pod'], (_file) => {
69-
expect(_file('app/foo/service.js')).to.equal(fixture('service/service.js'));
70-
71-
expect(_file('tests/unit/foo/service-test.js')).to.equal(
72-
fixture('service-test/default.js')
73-
);
74-
});
75-
});
76-
77-
it('service foo.js --pod', function () {
78-
return emberGenerateDestroy(['service', 'foo.js', '--pod'], (_file) => {
79-
expect(_file('app/foo.js/service.js')).to.not.exist;
80-
expect(_file('tests/unit/foo.js/service-test.js')).to.not.exist;
81-
82-
expect(_file('app/foo/service.js')).to.equal(fixture('service/service.js'));
83-
84-
expect(_file('tests/unit/foo/service-test.js')).to.equal(
85-
fixture('service-test/default.js')
86-
);
87-
});
88-
});
89-
90-
it('service foo/bar --pod', function () {
91-
return emberGenerateDestroy(['service', 'foo/bar', '--pod'], (_file) => {
92-
expect(_file('app/foo/bar/service.js')).to.equal(fixture('service/service-nested.js'));
93-
94-
expect(_file('tests/unit/foo/bar/service-test.js')).to.equal(
95-
fixture('service-test/default-nested.js')
96-
);
97-
});
98-
});
99-
100-
describe('with podModulePrefix', function () {
101-
beforeEach(function () {
102-
setupPodConfig({ podModulePrefix: true });
103-
});
104-
105-
it('service foo --pod', function () {
106-
return emberGenerateDestroy(['service', 'foo', '--pod'], (_file) => {
107-
expect(_file('app/pods/foo/service.js')).to.equal(fixture('service/service.js'));
108-
109-
expect(_file('tests/unit/pods/foo/service-test.js')).to.equal(
110-
fixture('service-test/default.js')
111-
);
112-
});
113-
});
114-
115-
it('service foo.js --pod', function () {
116-
return emberGenerateDestroy(['service', 'foo.js', '--pod'], (_file) => {
117-
expect(_file('app/pods/foo.js/service.js')).to.not.exist;
118-
expect(_file('tests/unit/pods/foo.js/service-test.js')).to.not.exist;
119-
120-
expect(_file('app/pods/foo/service.js')).to.equal(fixture('service/service.js'));
121-
122-
expect(_file('tests/unit/pods/foo/service-test.js')).to.equal(
123-
fixture('service-test/default.js')
124-
);
125-
});
126-
});
127-
128-
it('service foo/bar --pod', function () {
129-
return emberGenerateDestroy(['service', 'foo/bar', '--pod'], (_file) => {
130-
expect(_file('app/pods/foo/bar/service.js')).to.equal(
131-
fixture('service/service-nested.js')
132-
);
133-
134-
expect(_file('tests/unit/pods/foo/bar/service-test.js')).to.equal(
135-
fixture('service-test/default-nested.js')
136-
);
137-
});
138-
});
139-
});
140-
});
141-
14222
describe('in app - octane', function () {
14323
enableOctane();
14424

@@ -224,6 +104,8 @@ describe('Blueprint: service', function () {
224104
});
225105

226106
describe('with podModulePrefix', function () {
107+
enableOctane();
108+
227109
beforeEach(function () {
228110
setupPodConfig({ podModulePrefix: true });
229111
});
@@ -265,85 +147,6 @@ describe('Blueprint: service', function () {
265147
});
266148
});
267149

268-
describe('in addon', function () {
269-
beforeEach(function () {
270-
return emberNew({ target: 'addon' })
271-
.then(() =>
272-
modifyPackages([
273-
{ name: 'ember-qunit', delete: true },
274-
{ name: 'ember-cli-qunit', dev: true },
275-
])
276-
)
277-
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
278-
});
279-
280-
it('service foo', function () {
281-
return emberGenerateDestroy(['service', 'foo'], (_file) => {
282-
expect(_file('addon/services/foo.js')).to.equal(fixture('service/service.js'));
283-
284-
expect(_file('app/services/foo.js')).to.contain(
285-
"export { default } from 'my-addon/services/foo';"
286-
);
287-
288-
expect(_file('tests/unit/services/foo-test.js')).to.equal(
289-
fixture('service-test/default.js')
290-
);
291-
});
292-
});
293-
294-
it('service foo.js', function () {
295-
return emberGenerateDestroy(['service', 'foo.js'], (_file) => {
296-
expect(_file('addon/services/foo.js.js')).to.not.exist;
297-
expect(_file('app/services/foo.js.js')).to.not.exist;
298-
expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
299-
300-
expect(_file('addon/services/foo.js')).to.equal(fixture('service/service.js'));
301-
302-
expect(_file('app/services/foo.js')).to.contain(
303-
"export { default } from 'my-addon/services/foo';"
304-
);
305-
306-
expect(_file('tests/unit/services/foo-test.js')).to.equal(
307-
fixture('service-test/default.js')
308-
);
309-
});
310-
});
311-
312-
it('service foo/bar', function () {
313-
return emberGenerateDestroy(['service', 'foo/bar'], (_file) => {
314-
expect(_file('addon/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
315-
316-
expect(_file('app/services/foo/bar.js')).to.contain(
317-
"export { default } from 'my-addon/services/foo/bar';"
318-
);
319-
320-
expect(_file('tests/unit/services/foo/bar-test.js')).to.equal(
321-
fixture('service-test/default-nested.js')
322-
);
323-
});
324-
});
325-
326-
it('service foo/bar --dummy', function () {
327-
return emberGenerateDestroy(['service', 'foo/bar', '--dummy'], (_file) => {
328-
expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
329-
fixture('service/service-nested.js')
330-
);
331-
expect(_file('addon/services/foo/bar.js')).to.not.exist;
332-
});
333-
});
334-
335-
it('service foo/bar.js --dummy', function () {
336-
return emberGenerateDestroy(['service', 'foo/bar.js', '--dummy'], (_file) => {
337-
expect(_file('tests/dummy/app/services/foo/bar.js.js')).to.not.exist;
338-
339-
expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
340-
fixture('service/service-nested.js')
341-
);
342-
expect(_file('addon/services/foo/bar.js')).to.not.exist;
343-
});
344-
});
345-
});
346-
347150
describe('in addon - octane', function () {
348151
enableOctane();
349152

@@ -428,6 +231,8 @@ describe('Blueprint: service', function () {
428231
});
429232

430233
describe('in in-repo-addon', function () {
234+
enableOctane();
235+
431236
beforeEach(function () {
432237
return emberNew({ target: 'in-repo-addon' })
433238
.then(() =>
@@ -441,7 +246,9 @@ describe('Blueprint: service', function () {
441246

442247
it('service foo --in-repo-addon=my-addon', function () {
443248
return emberGenerateDestroy(['service', 'foo', '--in-repo-addon=my-addon'], (_file) => {
444-
expect(_file('lib/my-addon/addon/services/foo.js')).to.equal(fixture('service/service.js'));
249+
expect(_file('lib/my-addon/addon/services/foo.js')).to.equal(
250+
fixture('service/native-service.js')
251+
);
445252

446253
expect(_file('lib/my-addon/app/services/foo.js')).to.contain(
447254
"export { default } from 'my-addon/services/foo';"
@@ -459,7 +266,9 @@ describe('Blueprint: service', function () {
459266
expect(_file('lib/my-addon/app/services/foo.js.js')).to.not.exist;
460267
expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
461268

462-
expect(_file('lib/my-addon/addon/services/foo.js')).to.equal(fixture('service/service.js'));
269+
expect(_file('lib/my-addon/addon/services/foo.js')).to.equal(
270+
fixture('service/native-service.js')
271+
);
463272

464273
expect(_file('lib/my-addon/app/services/foo.js')).to.contain(
465274
"export { default } from 'my-addon/services/foo';"
@@ -474,7 +283,7 @@ describe('Blueprint: service', function () {
474283
it('service foo/bar --in-repo-addon=my-addon', function () {
475284
return emberGenerateDestroy(['service', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
476285
expect(_file('lib/my-addon/addon/services/foo/bar.js')).to.equal(
477-
fixture('service/service-nested.js')
286+
fixture('service/native-service-nested.js')
478287
);
479288

480289
expect(_file('lib/my-addon/app/services/foo/bar.js')).to.contain(

0 commit comments

Comments
 (0)