Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wait api #17

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Add wait api #17

merged 2 commits into from
Sep 7, 2017

Conversation

bilby91
Copy link
Contributor

@bilby91 bilby91 commented Sep 6, 2017

Solves #12

.wait(delay)
.then(() => afterDelayTime = Date.now())
.sendMessageToBot('have you waited ?', 'i waited some time')
.runTest();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to actually ensure that there is a ~1000 ms delay difference between the two times for this test to pass correctly.

Copy link
Owner

@microsoftly microsoftly Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually completely missed that you had the check integrated. I would update it though to explicitly check the before and after times instead of encoding it in the bot response, but this test is valid

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the README.md accordingly. You added in //``` for it as needed, I just don't have an automated doc builder for that portion yet, so its a manual process

src/BotTester.ts Outdated
* @param delayInMiliseconds time to wait in milliseconds
*/
public wait(delayInMilliseconds: number): BotTester {
this.testSteps.push(() => Promise.delay(delayInMilliseconds))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 spaces for indentation

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and terminate lines in a semicolon

.wait(delay)
.then(() => afterDelayTime = Date.now())
.sendMessageToBot('have you waited ?', 'i waited some time')
.runTest();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the README.md accordingly. You added in //``` for it as needed, I just don't have an automated doc builder for that portion yet, so its a manual process

@bilby91 bilby91 force-pushed the add-wait-api branch 3 times, most recently from a37eee0 to 39e1305 Compare September 6, 2017 21:44
Also:
  - Add linter to ci
@bilby91
Copy link
Contributor Author

bilby91 commented Sep 6, 2017

@microsoftly I add a ci script that is going to run in circleci that lints code before running test. I didn't update the docs folder because it was changing all the links, making them point to my fork.

@microsoftly
Copy link
Owner

@bilby91 just update README.md. As for the linter ... many of the expect lines (e.g. expect(collection).to.be.empty) cause a linter error. I need to check to see if there's a plugin for chai, throw in some exhaustive //tslint:disables, and or ignore the test scrips for blocking the built.

@bilby91 bilby91 closed this Sep 7, 2017
@bilby91 bilby91 reopened this Sep 7, 2017
@bilby91
Copy link
Contributor Author

bilby91 commented Sep 7, 2017

Hey, Readme and circleci files are already updated. Maybe you didn't notice because I amended my changes. I like to work with one commit per PR to have a more clear history. Let me know if their is any pending change.

@microsoftly
Copy link
Owner

Ah. Yep. I see it now. I think I overlooked it because the readme looks just like a test.

I'll add the circleci changes separately and first to get linting enforced.

@bilby91
Copy link
Contributor Author

bilby91 commented Sep 7, 2017 via email

@microsoftly microsoftly merged commit f982602 into microsoftly:master Sep 7, 2017
@santiagodoldan santiagodoldan deleted the add-wait-api branch October 16, 2017 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants