Skip to content

Commit

Permalink
chore: use gulp instead of grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
hongarc committed Mar 14, 2020
1 parent 17bce6b commit edfd052
Show file tree
Hide file tree
Showing 21 changed files with 2,035 additions and 1,501 deletions.
41 changes: 41 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"esversion": 6,
"curly": true,
"eqeqeq": false,
"regexp": false,
"nonew": false,
"latedef": false,
"forin": false,
"globalstrict": false,
"node": true,
"immed": true,
"newcap": true,
"noarg": true,
"bitwise": true,
"sub": true,
"undef": true,
"unused": true,
"trailing": true,
"devel": true,
"jquery": true,
"nonstandard": true,
"boss": true,
"eqnull": true,
"browser": true,
"debug": true,
"globals": {
"casper": true,
"Raphael": true,
"require": true,
"console": true,
"describe": true,
"expect": true,
"it": true,
"runs": true,
"waitsFor": true,
"exports": true,
"module": true,
"prompt": true,
"process": true
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ cache:
- "node_modules"
script:
- ./checkgit.sh "Source files were modified before build; is yarn.lock out of sync with package.json?" || travis_terminate $?
- yarn grunt
- yarn gulp
- ./checkgit.sh "Source files were modified by the build" || travis_terminate $?
252 changes: 0 additions & 252 deletions Gruntfile.js

This file was deleted.

67 changes: 9 additions & 58 deletions __tests__/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,61 +32,21 @@ var expectLevelAsync = function(headless, levelBlob) {
return;
}

var hasWarned = false;
var start;
runs(function() {
start = Date.now();
headless.sendCommand(command);
return headless.sendCommand(command).then(function() {
expect(compareLevelTree(headless, levelBlob)).toBeTruthy();
});
waitsFor(function() {
var diff = (Date.now() - start);
if (diff > TIME - 10 && !hasWarned) {
hasWarned = true;
console.log('this goal tree', loadTree(levelBlob.goalTreeString));
console.log('not going to match with command', command);
console.log(getHeadlessSummary(headless));
}
var result = compareLevelTree(headless, levelBlob);
if (result) {
console.log('solved level ' + levelBlob.name.en_US);
}
return result;
}, 'trees should be equal', TIME);
};

var expectTreeAsync = function(command, expectedJSON, startJSON) {
var headless = new HeadlessGit();
var start = Date.now();
var haveReported = false;

if (startJSON) {
headless.gitEngine.loadTreeFromString(startJSON);
}

runs(function() {
headless.sendCommand(command);
return headless.sendCommand(command).then(function() {
expect(compareAnswer(headless, expectedJSON)).toBeTruthy();
});
waitsFor(function() {
var diff = (Date.now() - start);
if (diff > TIME - 40 && !haveReported) {
haveReported = true;
var expected = loadTree(expectedJSON);
console.log('not going to match', command);
console.log('expected\n>>>>>>>>\n', expected);
console.log('\n<<<<<<<<<<<\nactual', getHeadlessSummary(headless));
console.log('\n<<<<ORIGIN>>>>>\n');
if (expected.originTree) {
console.log('expected origin tree:');
console.log(expected.originTree);
console.log('\n=========\n');
console.log('actual origin tree');
console.log(getHeadlessSummary(headless).originTree);
}
console.log(expectedJSON);
console.log(JSON.stringify(getHeadlessSummary(headless)));
}
return compareAnswer(headless, expectedJSON);
}, 'trees should be equal', 500);
};

var expectLevelSolved = function(levelBlob) {
Expand All @@ -102,20 +62,12 @@ var runCommand = function(command, resultHandler) {
var deferred = Q.defer();
var msg = null;

deferred.promise.then(function(commands) {
msg = commands[commands.length - 1].get('error').get('msg');
return headless.sendCommand(command, deferred).then(function() {
return deferred.promise.then(function(commands) {
msg = commands[commands.length - 1].get('error').get('msg');
resultHandler(msg);
});
});

runs(function() {
headless.sendCommand(command, deferred);
});
waitsFor(function() {
if(null == msg) {
return false;
}
resultHandler(msg);
return true;
}, 'commands should be finished', 500);
};

var TIME = 150;
Expand All @@ -131,4 +83,3 @@ module.exports = {
ONE_COMMIT_TREE: ONE_COMMIT_TREE,
runCommand: runCommand
};

Loading

0 comments on commit edfd052

Please sign in to comment.