shaunc / ember-grid

declarative table for ember
MIT License
15 stars 4 forks source link

testing framework #7

Closed shaunc closed 9 years ago

shaunc commented 9 years ago

@BryanCrotaz -- can we use ember-cli-mocha, or do you (and/or your developer) prefer qunit? I am going to go through and at least fix the default tests so that we have a passing build.

BryanCrotaz commented 9 years ago

We use qunit. What are the advantages of mocha?

shaunc commented 9 years ago

I don't mind qunit, but I like

BryanCrotaz commented 9 years ago

never used it but sounds good - go for it and show me how it's done

BryanCrotaz commented 9 years ago

feels like each section in the readme should become a test suite and each sentence should be a subsuite

shaunc commented 9 years ago

excellent...

... hmm...


Defining the window...

To specify the window, use the height and width attributes. The rowHeight attribute specifies the (outer) height of rows in the body of the grid.

describe('defining the window', ()=>{
  describe('to specify the window size, use the height and width attributes', ()=>{
    it('should size window to be 400x400', ()=>{
      ...
    }

Something like that?

BryanCrotaz commented 9 years ago

Each test should test exactly one thing, so tests for height and width individually within a suite. Suite names look good and understandable.

Just thinking that the way the readme is turning out, it's becoming a spec

shaunc commented 9 years ago

I used to use cucumber and that was the idea there. Here you've just written the documentation assiduously :)

shaunc commented 9 years ago

test module organization: We can put one test for each section per module in each file. ember has a default organization that we might want to be separate from as this is a bit different paradigm. Should I use ... say ... tests/specifications/<section-name>-test.js ?

shaunc commented 9 years ago

or specs rather than specifications

BryanCrotaz commented 9 years ago

sounds good

shaunc commented 9 years ago

I do more development in nodejs server side, where I use mocha all the time. Coming back to mocha in ember-cli now after a few months:


It seems in short the tooling I recommended is creaky. It does look like the tools are maintained so these issues will get resolved, but I thought I'd give you another shot: to you really want to learn mocha or not? It is nice, but that niceness is a bit obscured right now when working with ember-cli.

shaunc commented 9 years ago

(btw will be mostly "in transit" travelling from Poland -> Boston tomorrow/today)

shaunc commented 9 years ago

As noted, turning tail on ember-cli-mocha. Proposed new organization of tests:


spec/defining-the-window/
  height-and-width-test.js

    moduleForComponent(
      'spec/defining-the-window/height-and-width/height', 'control layout by specifying height',
       {integration: true});

    test('set height renders whole to specified height', ... )

Any comments?

BryanCrotaz commented 9 years ago

I just added tests in ember-cli-csp-style (and fixed the code, so npm update your ember-grid)

See what you think of my test style.

shaunc commented 9 years ago

They look good to me.