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

Failure while using F.attach(Qunit) #223

Closed
mgarg1 opened this Issue May 18, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@mgarg1

mgarg1 commented May 18, 2018

The code below is taken from the QUnit homepage with just 1 addition of funcunit.js
The failure point is F.attach(QUnit). The error is

ReferenceError: arugments is not defined
at Object. (https://rawgit.com/bitovi/funcunit/v3.4.2/dist/funcunit.js:8874:41)

I am looking for a workaround for this as this biting me at many other places.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.6.1.css">
</head>
<body>
  <div id="qunit"></div>
  <div id="qunit-fixture"></div>
  <script src="https://code.jquery.com/qunit/qunit-2.6.1.js"></script>
  <script type="text/javascript" src="https://rawgit.com/bitovi/funcunit/v3.4.2/dist/funcunit.js"></script>

  <script type="text/javascript">
    F.attach(QUnit);
    QUnit.test( "hello test", function( assert ) {
      assert.ok( 1 == "1", "Passed!" );
    });
  </script>
</body>
</html>
@chasenlehara

This comment has been minimized.

Member

chasenlehara commented May 18, 2018

I think this is the line that needs to be updated:

return test.apply(this, arugments);

@mgarg1 Would you be willing to submit a PR that fixes that line?

@mgarg1

This comment has been minimized.

mgarg1 commented May 23, 2018

@chasenlehara The issue is very complex then fixing this line. After fixing that line to :
return test.apply(this,(arguments === undefined ? assert : arguments));
I am seeing the failure in the same module at line 8879 which is because of the currentTestAssert is not being assigned prior to the execution of before hook.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.6.1.css">
</head>
<body>
  <div id="qunit"></div>
  <div id="qunit-fixture"></div>
  <script src="https://code.jquery.com/qunit/qunit-2.6.1.js"></script>
  <script type="text/javascript" src="https://rawgit.com/bitovi/funcunit/v3.4.2/dist/funcunit.js"></script>

  <script type="text/javascript">
    F.attach(QUnit);

    QUnit.module("MainTestModule", {
        before: function()
        {
            console.log("In Before");
            F.open("google.com",function(){});
        }
    });
    
    QUnit.test( "hello test", function( assert ) {
      assert.ok( 1 == "1", "Passed!" );
    });
  
  </script>
</body>
</html>

The adapter is taking care of the case when a test is executed but it fails to capture the correct assert when hooks are executed.In order to fix this issue just changing the QUnit.test won't suffice. We need to somehow do the same for module hooks.

m-mujica added a commit that referenced this issue Jun 23, 2018

m-mujica added a commit that referenced this issue Jun 23, 2018

Fix lint setup
Related to #223

@m-mujica m-mujica referenced this issue Jun 23, 2018

Merged

Fix lint setup #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment