chore: change printWidth from 80 to 100 (#362)

This commit is contained in:
Shohei Ueda authored and GitHub committed 2020-06-22 05:40:26 +09:00
1 parent b6801e6334
commit 4d89a385db
10 files changed
+32 -128

No files matched your search

+2 -6
View File
@@ -9,9 +9,7 @@ beforeEach(() => {
jest.resetModules();
process.stdout.write = jest.fn();
const doc = yaml.safeLoad(
fs.readFileSync(__dirname + '/../action.yml', 'utf8')
);
const doc = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
Object.keys(doc.inputs).forEach(name => {
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
process.env[envVar] = doc.inputs[name]['default'];
@@ -19,9 +17,7 @@ beforeEach(() => {
});
afterEach(() => {
const doc = yaml.safeLoad(
fs.readFileSync(__dirname + '/../action.yml', 'utf8')
);
const doc = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
Object.keys(doc.inputs).forEach(name => {
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
console.debug(`delete ${envVar}\t${process.env[envVar]}`);
+3 -20
View File
@@ -1,9 +1,4 @@
import {
getUserName,
getUserEmail,
setCommitAuthor,
getCommitMessage
} from '../src/git-utils';
import {getUserName, getUserEmail, setCommitAuthor, getCommitMessage} from '../src/git-utils';
import {getWorkDirName, createWorkDir} from '../src/utils';
import {CmdResult} from '../src/interfaces';
import * as exec from '@actions/exec';
@@ -138,13 +133,7 @@ describe('getCommitMessage()', () => {
});
test('get custom message', () => {
const test = getCommitMessage(
'Custom msg',
'',
'',
'actions/pages',
'commit_hash'
);
const test = getCommitMessage('Custom msg', '', '', 'actions/pages', 'commit_hash');
expect(test).toMatch('Custom msg commit_hash');
});
@@ -160,13 +149,7 @@ describe('getCommitMessage()', () => {
});
test('get full custom message', () => {
const test = getCommitMessage(
'',
'Full custom msg',
'',
'actions/pages',
'commit_hash'
);
const test = getCommitMessage('', 'Full custom msg', '', 'actions/pages', 'commit_hash');
expect(test).toMatch('Full custom msg');
});
+6 -22
View File
@@ -1,8 +1,4 @@
import {
getPublishRepo,
setPersonalToken,
setGithubToken
} from '../src/set-tokens';
import {getPublishRepo, setPersonalToken, setGithubToken} from '../src/set-tokens';
beforeEach(() => {
jest.resetModules();
@@ -26,8 +22,7 @@ describe('getPublishRepo()', () => {
describe('setGithubToken()', () => {
test('return remote url with GITHUB_TOKEN gh-pages', () => {
const expected =
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const test = setGithubToken(
'GITHUB_TOKEN',
'owner/repo',
@@ -40,8 +35,7 @@ describe('setGithubToken()', () => {
});
test('return remote url with GITHUB_TOKEN master', () => {
const expected =
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const test = setGithubToken(
'GITHUB_TOKEN',
'owner/repo',
@@ -55,14 +49,7 @@ describe('setGithubToken()', () => {
test('throw error master to master', () => {
expect(() => {
setGithubToken(
'GITHUB_TOKEN',
'owner/repo',
'master',
'',
'refs/heads/master',
'push'
);
setGithubToken('GITHUB_TOKEN', 'owner/repo', 'master', '', 'refs/heads/master', 'push');
}).toThrowError('You deploy from master to master');
});
@@ -76,14 +63,11 @@ describe('setGithubToken()', () => {
'refs/heads/master',
'push'
);
}).toThrowError(
'GITHUB_TOKEN does not support to push to an external repository'
);
}).toThrowError('GITHUB_TOKEN does not support to push to an external repository');
});
test('return remote url with GITHUB_TOKEN pull_request', () => {
const expected =
'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const expected = 'https://x-access-token:GITHUB_TOKEN@github.com/owner/repo.git';
const test = setGithubToken(
'GITHUB_TOKEN',
'owner/repo',