Skip to content

Commit 9a42503

Browse files
committed
chore: cleanup tests
Signed-off-by: CrazyMax <[email protected]>
1 parent a2e0289 commit 9a42503

File tree

5 files changed

+0
-25
lines changed

5 files changed

+0
-25
lines changed

__tests__/context.test.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,63 +16,54 @@ describe('getInputList', () => {
1616
it('single line correctly', async () => {
1717
await setInput('foo', 'bar');
1818
const res = await context.getInputList('foo');
19-
console.log(res);
2019
expect(res).toEqual(['bar']);
2120
});
2221

2322
it('multiline correctly', async () => {
2423
setInput('foo', 'bar\nbaz');
2524
const res = await context.getInputList('foo');
26-
console.log(res);
2725
expect(res).toEqual(['bar', 'baz']);
2826
});
2927

3028
it('empty lines correctly', async () => {
3129
setInput('foo', 'bar\n\nbaz');
3230
const res = await context.getInputList('foo');
33-
console.log(res);
3431
expect(res).toEqual(['bar', 'baz']);
3532
});
3633

3734
it('comma correctly', async () => {
3835
setInput('foo', 'bar,baz');
3936
const res = await context.getInputList('foo');
40-
console.log(res);
4137
expect(res).toEqual(['bar', 'baz']);
4238
});
4339

4440
it('empty result correctly', async () => {
4541
setInput('foo', 'bar,baz,');
4642
const res = await context.getInputList('foo');
47-
console.log(res);
4843
expect(res).toEqual(['bar', 'baz']);
4944
});
5045

5146
it('different new lines correctly', async () => {
5247
setInput('foo', 'bar\r\nbaz');
5348
const res = await context.getInputList('foo');
54-
console.log(res);
5549
expect(res).toEqual(['bar', 'baz']);
5650
});
5751

5852
it('different new lines and comma correctly', async () => {
5953
setInput('foo', 'bar\r\nbaz,bat');
6054
const res = await context.getInputList('foo');
61-
console.log(res);
6255
expect(res).toEqual(['bar', 'baz', 'bat']);
6356
});
6457

6558
it('multiline and ignoring comma correctly', async () => {
6659
setInput('cache-from', 'user/app:cache\ntype=local,src=path/to/dir');
6760
const res = await context.getInputList('cache-from', true);
68-
console.log(res);
6961
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
7062
});
7163

7264
it('different new lines and ignoring comma correctly', async () => {
7365
setInput('cache-from', 'user/app:cache\r\ntype=local,src=path/to/dir');
7466
const res = await context.getInputList('cache-from', true);
75-
console.log(res);
7667
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
7768
});
7869

@@ -86,7 +77,6 @@ ccccccccc"
8677
FOO=bar`
8778
);
8879
const res = await context.getInputList('secrets', true);
89-
console.log(res);
9080
expect(res).toEqual([
9181
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
9282
`MYSECRET=aaaaaaaa
@@ -110,7 +100,6 @@ bbbb
110100
ccc"`
111101
);
112102
const res = await context.getInputList('secrets', true);
113-
console.log(res);
114103
expect(res).toEqual([
115104
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
116105
`MYSECRET=aaaaaaaa
@@ -134,7 +123,6 @@ ccccccccc
134123
FOO=bar`
135124
);
136125
const res = await context.getInputList('secrets', true);
137-
console.log(res);
138126
expect(res).toEqual(['GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'MYSECRET=aaaaaaaa', 'bbbbbbb', 'ccccccccc', 'FOO=bar']);
139127
});
140128

@@ -148,7 +136,6 @@ ccccccccc"
148136
FOO=bar`
149137
);
150138
const res = await context.getInputList('secrets', true);
151-
console.log(res);
152139
expect(res).toEqual([
153140
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
154141
`MYSECRET=aaaaaaaa

__tests__/flavor.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ describe('transform', () => {
168168
])('given %p attributes ', async (inputs: string[], expected: Flavor, invalid: boolean) => {
169169
try {
170170
const flavor = Transform(inputs);
171-
console.log(flavor);
172171
expect(flavor).toEqual(expected);
173172
} catch (err) {
174173
if (!invalid) {

__tests__/github.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jest.spyOn(github, 'repo').mockImplementation((): Promise<github.ReposGetRespons
88
describe('repo', () => {
99
it('returns GitHub repository', async () => {
1010
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
11-
console.log(repo);
1211
expect(repo.name).not.toBeNull();
1312
});
1413
});

__tests__/meta.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,17 @@ beforeEach(() => {
3434
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
3535
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
3636
const context = github.context();
37-
console.log(process.env, context);
3837

3938
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
4039
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
4140

4241
const version = meta.version;
43-
console.log('version', version);
4442
expect(version).toEqual(exVersion);
4543

4644
const tags = meta.getTags();
47-
console.log('tags', tags);
4845
expect(tags).toEqual(exTags);
4946

5047
const labels = meta.getLabels();
51-
console.log('labels', labels);
5248
expect(labels).toEqual(exLabels);
5349
};
5450

@@ -3152,13 +3148,11 @@ describe('json', () => {
31523148
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exJSON: {}) => {
31533149
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
31543150
const context = github.context();
3155-
console.log(process.env, context);
31563151

31573152
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
31583153
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
31593154

31603155
const jsonOutput = meta.getJSON();
3161-
console.log('json', jsonOutput);
31623156
expect(jsonOutput).toEqual(exJSON);
31633157
});
31643158
});
@@ -3459,13 +3453,11 @@ describe('bake', () => {
34593453
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exBakeDefinition: {}) => {
34603454
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
34613455
const context = github.context();
3462-
console.log(process.env, context);
34633456

34643457
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
34653458
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
34663459

34673460
const bakeFile = meta.getBakeFile();
3468-
console.log('bakeFile', bakeFile, fs.readFileSync(bakeFile, 'utf8'));
34693461
expect(JSON.parse(fs.readFileSync(bakeFile, 'utf8'))).toEqual(exBakeDefinition);
34703462
});
34713463
});

__tests__/tag.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ describe('transform', () => {
9999
])('given %p', async (l: string[], expected: Tag[], invalid: boolean) => {
100100
try {
101101
const tags = Transform(l);
102-
console.log(tags);
103102
expect(tags).toEqual(expected);
104103
} catch (err) {
105104
if (!invalid) {
@@ -429,7 +428,6 @@ describe('parse', () => {
429428
])('given %p event ', async (s: string, expected: Tag, invalid: boolean) => {
430429
try {
431430
const tag = Parse(s);
432-
console.log(tag);
433431
expect(tag).toEqual(expected);
434432
} catch (err) {
435433
if (!invalid) {

0 commit comments

Comments
 (0)