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

First working version #1

Merged
merged 7 commits into from
Oct 21, 2015
Merged

First working version #1

merged 7 commits into from
Oct 21, 2015

Conversation

jkrems
Copy link
Member

@jkrems jkrems commented Oct 19, 2015

Straight port from testium. One difference: We also expose an alternate interface which is a awesome (awful?) prototype hack which allows us to side-step the previous need for using this and do the following instead:

import { browser } from 'testium-mocha';

describe('foo', () => {
  before(browser.beforeHook());

  it('does stuff', () => {
    browser.navigateTo('/');
  });
});

The old syntax still works:

injectBrowser = require 'testium-mocha'

describe 'foo', ->
  before injectBrowser()

  it 'does stuff', ->
    @browser.navigateTo '/'

Depends on:

Part of groupon/testium#171

@jkrems
Copy link
Member Author

jkrems commented Oct 19, 2015

@EndangeredMassa The good news: I figured out a way to make browser work without relying on mocha's test context. The bad news: It's using __proto__ magic.


function uniqueFile(file) {
var testPath = file;
var counter = null;
Copy link

Choose a reason for hiding this comment

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

Could this be counter = 0 and you can remove the counter || 0 check below (i.e. counter++)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice! Done.

return testPath + '.png';
}

function getFile(directory, title) {
Copy link

Choose a reason for hiding this comment

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

Should this method be renamed to something more specific like slugifyFile?

Copy link
Member Author

Choose a reason for hiding this comment

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

generateFilename? "slug" implies dashes for me, so I feel like it's too specific.

@jkrems
Copy link
Member Author

jkrems commented Oct 21, 2015

Updated.

@ghost
Copy link

ghost commented Oct 21, 2015

:shipit:

jkrems added a commit that referenced this pull request Oct 21, 2015
@jkrems jkrems merged commit 12527f4 into master Oct 21, 2015
@jkrems jkrems deleted the jk-initial branch October 21, 2015 23:46
@EndangeredMassa
Copy link
Member

I can't find the jk-initial branch on this repo. Can you try pushing it up again?

@EndangeredMassa
Copy link
Member

Oh, it was merged and deleted. That makes sense!

@jkrems jkrems restored the jk-initial branch October 22, 2015 02:20
@jkrems
Copy link
Member Author

jkrems commented Oct 22, 2015

Ah, sorry. Restored it for now so any builds depending on it pass. But there's also 1.0.0 now for proper dependencies. :)

@jkrems jkrems deleted the jk-initial branch February 8, 2019 15:06
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.

2 participants