question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests shown under wrong block in spec reporter

See original GitHub issue

The “Spec” Reporter is showing my tests under the wrong describe block

I have 5 test files in 2 directories under my test folder: attributes and events.

All tests are using async/await

How do I start rooting this out???

Describe Blocks (in alphabetical folder/file order):

attributes/day-format.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Attributes', () => {
    describe('.dayFormat', () => {
      ...
    })
  });
});

attributes/header-format.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Attributes', () => {
    describe('.headerFormat', () => {
      ...
    })
  });
});

attributes/header-style.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Attributes', () => {
    describe('.headerStyle', () => {
      ...
    })
  });
});

attributes/label-format.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Attributes', () => {
    describe('.labelFormat', () => {
      ...
    })
  });
});

attributes/selected-date.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Attributes', () => {
    describe('.selectedDate', () => {
      ...
    })
  });
});

events/date-change.test.js

describe('CalendarElement (<calendar-element></calendar-element>)', () => {
  describe('Events', () => {
    describe('.date-change', () => {
      ...
    })
  });
});

Reported Results:

CalendarElement (<calendar-element></calendar-element>)
    Attributes
      .labelFormat
        ✔ is EEEE by default
        ✔ is is bound to the `label-format` attribute
        when a valid format is entered
          ✔ is reset back to default
        when an invalid format is entered
          ✔ is reset back to default
          ✔ Logs a RangeError
      .headerStyle
        ✔ is an empty string by default
        ✔ is is bound to the `header-style` attribute
        ✔ is cooerced to an unvalidated string
        ✔ is rendered in the section header
      .headerFormat
        ✔ is MMMM yyyy by default
        ✔ is is bound to the `header-format` attribute
        when a valid format is entered
          ✔ is reset back to default
        when an invalid format is entered
          ✔ is reset back to default
          ✔ Logs a RangeError
    Events
      date-change
        ✔ is fired when .selectedDate changes
        Properties
          .bubbles
            ✔ is true
          .composed
            ✔ is true
          .cancelable
            ✔ is true
          .detail
            ✔ is an object
            Properties
              value
                when .selectedDate is set
                  ✔ is a String
                  ✔ is the current .selectedDate in ISO 8601 format (yyyy-MM-dd)
                when .selectedDate is unset
                  ✔ is null
              date
                when .selectedDate is set
                  ✔ is a Date
                  ✔ is the current .selectedDate
                when .selectedDate is unset
                  ✔ is null
/***** EVERYTHING BELOW IS SUPPOSED TO BE IN THE `Attributes` BLOCK *****/
      .selectedDate
        ✔ is empty by default
        ✔ is is bound to the `selected-date` attribute
        ✔ is set by clicking a date cell
        when an invalid date is entered
          ✔ sets the value to NULL
          ✔ Logs the invalid date as an Error
      .dayFormat
        ✔ is d by default
        ✔ is is bound to the `day-format` attribute
        when a valid format is entered
          ✔ is reset back to default
        when an invalid format is entered
          ✔ is reset back to default
          ✔ Logs a RangeError

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
boneskullcommented, Sep 5, 2019

If you’re running with karma, you’re using karma’s reporter, not mocha…

0reactions
SampsonCrowleycommented, Jan 22, 2020

Would be nice if this wasn’t completely ignored

Read more comments on GitHub >

github_iconTop Results From Across the Web

reporter "wdio-spec-reporter" is not installed · Issue #1129
Following the 4.x I get this error while trying to use the spec ... Failing tests will be displayed the same way like...
Read more >
Summarize protractor results over multiple spec files
Each spec file has an average of one "describe" block, each usually having multiple "it" blocks. I'm currently using jasmine-spec-reporter which ...
Read more >
Spec Reporter - WebdriverIO
A WebdriverIO plugin to report in spec style.
Read more >
Jasmine Spec Report - Reports #1 | Protractor Tutorial | LetCode
Reporting is very essential in the world of testing, let us start with very basic by using the Jasmine Spec Reporter.
Read more >
Mocha documentation — DevDocs
If you use callback-based async tests, Mocha will throw an error if ... and flag tests that are slow (default: 75ms), as shown...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found