From a8b74e13434f9f30a98316bad519a63abc1b0105 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Tue, 27 Nov 2018 23:04:49 +0530 Subject: [PATCH] fix(#28): getContent() => getContents() --- lib/index.js | 2 +- lib/index.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 716c884..f13101e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -45,7 +45,7 @@ function deepMergeConfigs(configs, options) { */ async function loadYaml(context, params) { try { - const response = await context.github.repos.getContent(params); + const response = await context.github.repos.getContents(params); return parseConfig(response.data.content); } catch (e) { if (e.code === 404) { diff --git a/lib/index.test.js b/lib/index.test.js index 1eda097..884179b 100644 --- a/lib/index.test.js +++ b/lib/index.test.js @@ -3,7 +3,7 @@ const getConfig = require('./index'); const { fn } = jest; -function mockContext(getContent) { +function mockContext(getContents) { return { repo(params) { return Object.assign( @@ -17,8 +17,8 @@ function mockContext(getContent) { github: { repos: { - async getContent(params) { - const content = Buffer.from(getContent(params)).toString('base64'); + async getContents(params) { + const content = Buffer.from(getContents(params)).toString('base64'); return { data: { content,