Skip to content

Commit

Permalink
fix bower builds
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 10, 2016
1 parent d667c02 commit 79473ca
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
Binary file removed id_ed25519_nginfinite.enc
Binary file not shown.
Binary file added id_rsa_nginfinite.enc
Binary file not shown.
8 changes: 8 additions & 0 deletions inert-bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "ng-infinite-scroll-npm-is-better-than-bower",
"main": "build/ng-infinite-scroll.js",
"license": "AGPL",
"dependencies": {
"angular": ">=1.2.0"
}
}
9 changes: 5 additions & 4 deletions make-bower-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in id_ed25519_nginfinite.enc -out deploy_key -d
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in id_rsa_nginfinite.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key
Expand All @@ -37,11 +37,12 @@ git config user.email "$COMMIT_AUTHOR_EMAIL"

# Copy all build content to the bower repo
cp -r ../build .
cp -r ../src .
cp ../inert-bower.json bower.json

git add build
git add src
git add bower.json

git commit -am "Release version $TRAVIS_TAG"
git tag -d "$TRAVIS_TAG" || true
git tag "$TRAVIS_TAG"
git push origin $TARGET_BRANCH $TRAVIS_TAG
git push origin -f $TARGET_BRANCH $TRAVIS_TAG
25 changes: 19 additions & 6 deletions test/spec/ng-infinite-scroll.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import fs from 'fs';
import mkdirp from 'mkdirp';

function retry(times, fn) {
function doRetry() {
for (let i = 0; i < (times - 1); i += 1) {
try {
return fn();
} catch (e) {
// does nothing;
}
}

return fn();
}

return doRetry;
}

const containers = {
window: {
start: '',
Expand Down Expand Up @@ -236,20 +252,17 @@ function describeTests(angularVersion, container) {
);

return describe('with an event handler', () =>

it('calls the event handler on an event', function () {
it('calls the event handler on an event', retry(4, function () {
replaceIndexFile("infinite-scroll-listen-for-event='anEvent'", throttle);
browser.get(pathToDocument);
expect(getItems().count()).toBe(100);
browser.driver.executeScript(collapseItemsScript);
expect(getItems().count()).toBe(100);
element(By.id('trigger')).click();
expect(getItems().count()).toBe(100);
browser.sleep(throttle);
browser.sleep(100);
return expect(getItems().count()).toBe(200);
}
)

}))
);
}
);
Expand Down

0 comments on commit 79473ca

Please sign in to comment.