Skip to content

Commit

Permalink
Don't skip test (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Sep 28, 2020
1 parent 7afc23c commit 16477d7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"prettier": true,
"rules": {
"ava/no-import-test-files": "off",
"ava/no-skip-test": "off",
"camelcase": "off"
}
}
Expand Down
65 changes: 34 additions & 31 deletions test/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,42 +74,45 @@ test.cb('should not delete a fork that has more branches', (t) => {
});

// Currently our logic does not delete this fork
test.skip('should delete a fork that has more branches, but all at upstream branch tips', (t) => {
const mock = lib.mock({
listBranches(arguments_) {
if (arguments_.user === lib.USER.login) {
test.cb(
'should delete a fork that has more branches, but all at upstream branch tips',
(t) => {
const mock = lib.mock({
listBranches(arguments_) {
if (arguments_.user === lib.USER.login) {
return [
{name: 'master', commit: lib.COMMIT_A},
{name: 'foo', commit: lib.COMMIT_A},
{name: 'bar', commit: lib.COMMIT_B}
];
}

return [
{name: 'master', commit: lib.COMMIT_A},
{name: 'foo', commit: lib.COMMIT_A},
{name: 'bar', commit: lib.COMMIT_B}
{name: 'baz', commit: lib.COMMIT_B}
];
}

return [
{name: 'master', commit: lib.COMMIT_A},
{name: 'baz', commit: lib.COMMIT_B}
];
},
delete: true
});
},
delete: true
});

removeGithubForks(mock.present, (error) => {
if (error) return t.fail(error);
lib.check(t, mock.calls(), [
['listForAuthenticatedUser', {type: 'public'}],
['get', {owner: lib.USER.login, repo: 'fork1'}],
['listBranches', {owner: lib.USER.login, repo: 'fork1', per_page: 100}],
[
'listBranches',
{owner: lib.AUTHOR.login, repo: 'upstream-lib', per_page: 100}
],
['delete', {owner: lib.USER.login, repo: 'fork1', url: undefined}]
]);
removeGithubForks(mock.present, (error) => {
if (error) return t.fail(error);
lib.check(t, mock.calls(), [
['listForAuthenticatedUser', {type: 'public'}],
['get', {owner: lib.USER.login, repo: 'fork1'}],
['listBranches', {owner: lib.USER.login, repo: 'fork1', per_page: 100}],
[
'listBranches',
{owner: lib.AUTHOR.login, repo: 'upstream-lib', per_page: 100}
],
['delete', {owner: lib.USER.login, repo: 'fork1', url: undefined}]
]);

// eslint-disable-next-line ava/no-invalid-end
t.end();
});
});
// eslint-disable-next-line ava/no-invalid-end
t.end();
});
}
);

test.cb(
'should delete a fork that has all branches at upstream branch tips',
Expand Down

0 comments on commit 16477d7

Please sign in to comment.