Skip to content

Commit

Permalink
Merge pull request #164 from Financial-Times/cpp-660-remove-n-cluster
Browse files Browse the repository at this point in the history
remove references to n-cluster
  • Loading branch information
leannecornish-ft authored Jan 7, 2022
2 parents f2b01b5 + 7e934e4 commit c472290
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions test/commands/contents.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('contents command handler', () => {
test('when contents handler is called with valid <file> and <search> values, a list of repositories are logged', async () => {
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -179,7 +179,7 @@ describe('contents command handler', () => {
test('when contents handler is called with valid <file> and <search> and <repo list> values, a list of repositories are logged', async () => {
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand Down Expand Up @@ -210,7 +210,7 @@ describe('contents command handler', () => {
test('empty `contents` search, logs existence of file', async () => {
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand Down Expand Up @@ -254,7 +254,7 @@ describe('contents command handler', () => {
test('<search> value not found, does not log (with verbose flag)', async () => {
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand Down Expand Up @@ -472,7 +472,7 @@ describe.each([
repos.forEach(repo => {
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});
});
Expand Down
30 changes: 15 additions & 15 deletions test/lib/ebi/contents-search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('contentsSearch resultsAsync', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -50,7 +50,7 @@ describe('contentsSearch resultsAsync', () => {

await expect(result).resolves.toEqual({
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: undefined,
repository: 'Financial-Times/ebi',
search: 'web:',
Expand All @@ -62,7 +62,7 @@ describe('contentsSearch resultsAsync', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -75,7 +75,7 @@ describe('contentsSearch resultsAsync', () => {

await expect(result).resolves.toEqual({
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: 'w..:',
repository: 'Financial-Times/ebi',
search: undefined,
Expand All @@ -87,7 +87,7 @@ describe('contentsSearch resultsAsync', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -101,7 +101,7 @@ describe('contentsSearch resultsAsync', () => {

await expect(result).resolves.toEqual({
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: 'w..:',
repository: 'Financial-Times/ebi',
search: 'nope',
Expand All @@ -113,25 +113,25 @@ describe('contentsSearch resultsAsync', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

const ebiSearch = contentsSearch({
search: 'node',
search: 'worker',
filepath: 'Procfile'
});
const { resultsAsync } = await ebiSearch([repo]);
const [result] = resultsAsync;

await expect(result).resolves.toEqual({
message:
"INFO: 'Procfile' has no match for 'node' in 'Financial-Times/ebi'",
"INFO: 'Procfile' has no match for 'worker' in 'Financial-Times/ebi'",
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: undefined,
repository: 'Financial-Times/ebi',
search: 'node',
search: 'worker',
type: RESULT_TYPES.noMatch
});
});
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('contentsSearch getResults', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -182,7 +182,7 @@ describe('contentsSearch getResults', () => {

const expectedResult = {
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: undefined,
repository: 'Financial-Times/ebi',
search: 'web:',
Expand All @@ -199,7 +199,7 @@ describe('contentsSearch getResults', () => {
const repo = 'Financial-Times/ebi';
nockScope.get(`/${repo}/contents/Procfile`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});

Expand All @@ -217,7 +217,7 @@ describe('contentsSearch getResults', () => {

const expectedResult = {
filepath: 'Procfile',
fileContents: 'web: n-cluster server/init.js',
fileContents: 'web: node --max-http-header-size=80000 server/cluster.js',
regex: undefined,
repository: 'Financial-Times/ebi',
message:
Expand Down
4 changes: 2 additions & 2 deletions test/lib/get-contents.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe('getContents', () => {
const filepath = 'Procfile';
nockScope.get(`/${repo}/contents/${filepath}`).reply(200, {
type: 'file',
content: base64Encode('web: n-cluster server/init.js'),
content: base64Encode('web: node --max-http-header-size=80000 server/cluster.js'),
path: 'Procfile'
});
const getPathContents = getContents({
filepath,
githubToken: '123'
});
expect(await getPathContents(repo)).toContain('web: n-cluster');
expect(await getPathContents(repo)).toContain('web: node --max-http-header-size=80000 server/cluster.js');
});

test('when repository not found correct error is thrown', async () => {
Expand Down

0 comments on commit c472290

Please sign in to comment.