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

setting up component testing on a project and running testing on just one test fails silently #3902

Closed
oanabotezat opened this issue Aug 29, 2023 · 1 comment
Labels

Comments

@oanabotezat
Copy link
Collaborator

Description of the bug/issue

When I setup testing for a project and start with just one test I get no indication of a failure.

% npx nightwatch tests/src/ --verbose
 Launching up to 1 concurrent test worker processes...

Running   default: sampleTest.js  

after adding the --serial flag I can actually see that there are errors.

% npx nightwatch tests/src/ --verbose --serial
    Error   unhandledRejection: Error while loading the API commands: the command .importScript() is already defined.
[...]

  ️TEST FAILURE (267ms): 
   - 1 error during execution; 
   - 0 tests failed; 
   - 0/NA tests passed

A flag should NOT be necessary.

Steps to reproduce

  1. npm init nightwatch
  2. have just 1 test available, that fails.
  3. run npx nightwatch

Sample test

describe('user info test', function() {
  let component;
  
  before(async () => {
    component = await browser.mountComponent('/src/components/UserInfo.jsx', function() {
      return {
        date: new Date(),
        text: 'I hope you enjoy reading Ulysses!',
        author: {
          name: 'Leopold Bloom',
          avatarUrl: 'https://upload.wikimedia.org/wikipedia/commons/5/52/Poldy.png'
        }
      }
    });
  });
  
  it('should render the component without error', function() {
    browser.expect(component).to.be.visible;
  })
})

Command to run

npx nightwatch

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

3.1.3

Node Version

v18.14.2

Browser

No response

Operating System

No response

Additional Information

No response

@gravityvi gravityvi added the bug label Aug 29, 2023
@gravityvi
Copy link
Member

gravityvi commented Oct 11, 2023

This was fixed in #3828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants