Skip to content

Commit de51777

Browse files
author
Robert Jackson
committed
Bring back commented out tests.
1 parent a747699 commit de51777

File tree

1 file changed

+109
-108
lines changed

1 file changed

+109
-108
lines changed
Lines changed: 109 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
//const assertDiff = require('assert-diff');
1+
const assertDiff = require('assert-diff');
22
const fse = require('fs-extra');
3-
//const path = require('path');
4-
//const Migrator = require('../../../lib/migrator');
3+
const fixturify = require('fixturify');
4+
const path = require('path');
5+
const Migrator = require('../../../lib/migrator');
56

6-
//assertDiff.options.strict = true;
7+
assertDiff.options.strict = true;
78

89
describe('structure = nested', function () {
910
beforeEach(function () {
@@ -15,147 +16,147 @@ describe('structure = nested', function () {
1516
fse.removeSync(this.tmpPath);
1617
});
1718

18-
// describe('For an app with component classes written in JavaScript', function() {
19-
// beforeEach(function() {
20-
// const fixturePath = path.resolve(__dirname, '../../fixtures/app/example-js');
19+
describe('For an app with component classes written in JavaScript', function () {
20+
beforeEach(function () {
21+
const fixturePath = path.resolve(__dirname, '../../fixtures/app/example-js');
2122

22-
// // Find input and output files
23-
// const input = require(`${fixturePath}/input`);
24-
// this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
23+
// Find input and output files
24+
const input = require(`${fixturePath}/input`);
25+
this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
2526

26-
// // Copy the input file to the temporary folder
27-
// fixturify.writeSync(this.tmpPath, input);
27+
// Copy the input file to the temporary folder
28+
fixturify.writeSync(this.tmpPath, input);
2829

29-
// // Create an instance of the Migrator class
30-
// this.migrator = new Migrator({
31-
// projectRoot: this.tmpPath,
32-
// structure: 'nested'
33-
// });
34-
// });
30+
// Create an instance of the Migrator class
31+
this.migrator = new Migrator({
32+
projectRoot: this.tmpPath,
33+
structure: 'nested',
34+
});
35+
});
3536

36-
// it('Codemod works as expected', async function() {
37-
// await this.migrator.execute();
37+
it('Codemod works as expected', async function () {
38+
await this.migrator.execute();
3839

39-
// const actualOutput = fixturify.readSync(this.tmpPath);
40+
const actualOutput = fixturify.readSync(this.tmpPath);
4041

41-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
42-
// });
42+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
43+
});
4344

44-
// it('Codemod is idempotent', async function() {
45-
// await this.migrator.execute();
46-
// await this.migrator.execute();
45+
it('Codemod is idempotent', async function () {
46+
await this.migrator.execute();
47+
await this.migrator.execute();
4748

48-
// const actualOutput = fixturify.readSync(this.tmpPath);
49+
const actualOutput = fixturify.readSync(this.tmpPath);
4950

50-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
51-
// });
52-
// });
51+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
52+
});
53+
});
5354

54-
// describe('For an app with component classes written in TypeScript', function() {
55-
// beforeEach(function() {
56-
// const fixturePath = path.resolve(__dirname, '../../fixtures/app/example-ts');
55+
describe('For an app with component classes written in TypeScript', function () {
56+
beforeEach(function () {
57+
const fixturePath = path.resolve(__dirname, '../../fixtures/app/example-ts');
5758

58-
// // Find input and output files
59-
// const input = require(`${fixturePath}/input`);
60-
// this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
59+
// Find input and output files
60+
const input = require(`${fixturePath}/input`);
61+
this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
6162

62-
// // Copy the input file to the temporary folder
63-
// fixturify.writeSync(this.tmpPath, input);
63+
// Copy the input file to the temporary folder
64+
fixturify.writeSync(this.tmpPath, input);
6465

65-
// // Create an instance of the Migrator class
66-
// this.migrator = new Migrator({
67-
// projectRoot: this.tmpPath,
68-
// structure: 'nested'
69-
// });
70-
// });
66+
// Create an instance of the Migrator class
67+
this.migrator = new Migrator({
68+
projectRoot: this.tmpPath,
69+
structure: 'nested',
70+
});
71+
});
7172

72-
// it('Codemod works as expected', async function() {
73-
// await this.migrator.execute();
73+
it('Codemod works as expected', async function () {
74+
await this.migrator.execute();
7475

75-
// const actualOutput = fixturify.readSync(this.tmpPath);
76+
const actualOutput = fixturify.readSync(this.tmpPath);
7677

77-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
78-
// });
78+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
79+
});
7980

80-
// it('Codemod is idempotent', async function() {
81-
// await this.migrator.execute();
82-
// await this.migrator.execute();
81+
it('Codemod is idempotent', async function () {
82+
await this.migrator.execute();
83+
await this.migrator.execute();
8384

84-
// const actualOutput = fixturify.readSync(this.tmpPath);
85+
const actualOutput = fixturify.readSync(this.tmpPath);
8586

86-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
87-
// });
88-
// });
87+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
88+
});
89+
});
8990

90-
// describe('For an addon with component classes written in JavaScript', function() {
91-
// beforeEach(function() {
92-
// const fixturePath = path.resolve(__dirname, '../../fixtures/addon/example-js');
91+
describe('For an addon with component classes written in JavaScript', function () {
92+
beforeEach(function () {
93+
const fixturePath = path.resolve(__dirname, '../../fixtures/addon/example-js');
9394

94-
// // Find input and output files
95-
// const input = require(`${fixturePath}/input`);
96-
// this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
95+
// Find input and output files
96+
const input = require(`${fixturePath}/input`);
97+
this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
9798

98-
// // Copy the input file to the temporary folder
99-
// fixturify.writeSync(this.tmpPath, input);
99+
// Copy the input file to the temporary folder
100+
fixturify.writeSync(this.tmpPath, input);
100101

101-
// // Create an instance of the Migrator class
102-
// this.migrator = new Migrator({
103-
// projectRoot: this.tmpPath,
104-
// structure: 'nested'
105-
// });
106-
// });
102+
// Create an instance of the Migrator class
103+
this.migrator = new Migrator({
104+
projectRoot: this.tmpPath,
105+
structure: 'nested',
106+
});
107+
});
107108

108-
// it('Codemod works as expected', async function() {
109-
// await this.migrator.execute();
109+
it('Codemod works as expected', async function () {
110+
await this.migrator.execute();
110111

111-
// const actualOutput = fixturify.readSync(this.tmpPath);
112+
const actualOutput = fixturify.readSync(this.tmpPath);
112113

113-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
114-
// });
114+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
115+
});
115116

116-
// it('Codemod is idempotent', async function() {
117-
// await this.migrator.execute();
118-
// await this.migrator.execute();
117+
it('Codemod is idempotent', async function () {
118+
await this.migrator.execute();
119+
await this.migrator.execute();
119120

120-
// const actualOutput = fixturify.readSync(this.tmpPath);
121+
const actualOutput = fixturify.readSync(this.tmpPath);
121122

122-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
123-
// });
124-
// });
123+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
124+
});
125+
});
125126

126-
// describe('For an addon with component classes written in TypeScript', function() {
127-
// beforeEach(function() {
128-
// const fixturePath = path.resolve(__dirname, '../../fixtures/addon/example-ts');
127+
describe('For an addon with component classes written in TypeScript', function () {
128+
beforeEach(function () {
129+
const fixturePath = path.resolve(__dirname, '../../fixtures/addon/example-ts');
129130

130-
// // Find input and output files
131-
// const input = require(`${fixturePath}/input`);
132-
// this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
131+
// Find input and output files
132+
const input = require(`${fixturePath}/input`);
133+
this.expectedOutput = require(`${fixturePath}/classic-to-nested`);
133134

134-
// // Copy the input file to the temporary folder
135-
// fixturify.writeSync(this.tmpPath, input);
135+
// Copy the input file to the temporary folder
136+
fixturify.writeSync(this.tmpPath, input);
136137

137-
// // Create an instance of the Migrator class
138-
// this.migrator = new Migrator({
139-
// projectRoot: this.tmpPath,
140-
// structure: 'nested'
141-
// });
142-
// });
138+
// Create an instance of the Migrator class
139+
this.migrator = new Migrator({
140+
projectRoot: this.tmpPath,
141+
structure: 'nested',
142+
});
143+
});
143144

144-
// it('Codemod works as expected', async function() {
145-
// await this.migrator.execute();
145+
it('Codemod works as expected', async function () {
146+
await this.migrator.execute();
146147

147-
// const actualOutput = fixturify.readSync(this.tmpPath);
148+
const actualOutput = fixturify.readSync(this.tmpPath);
148149

149-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
150-
// });
150+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
151+
});
151152

152-
// it('Codemod is idempotent', async function() {
153-
// await this.migrator.execute();
154-
// await this.migrator.execute();
153+
it('Codemod is idempotent', async function () {
154+
await this.migrator.execute();
155+
await this.migrator.execute();
155156

156-
// const actualOutput = fixturify.readSync(this.tmpPath);
157+
const actualOutput = fixturify.readSync(this.tmpPath);
157158

158-
// assertDiff.deepEqual(actualOutput, this.expectedOutput);
159-
// });
160-
// });
159+
assertDiff.deepEqual(actualOutput, this.expectedOutput);
160+
});
161+
});
161162
});

0 commit comments

Comments
 (0)