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

'use strict' declaration doesn't seem to do anything #70

Closed
awei01 opened this issue Jun 12, 2014 · 3 comments
Closed

'use strict' declaration doesn't seem to do anything #70

awei01 opened this issue Jun 12, 2014 · 3 comments

Comments

@awei01
Copy link

awei01 commented Jun 12, 2014

The 'use strict' declaration in scripts doesn't seem to have any effect in files or in test files.

module file:

\\ foo.js
(function() {
'use strict';

foo = 'foo value';

module.exports = foo;
}());

and test file:

\\ __tests__\foo-test.js
(function() {
'use strict';

jest.dontMock('../foo.js');

    describe('testing use strict', function() {
         it('should throw some sort of error', function() {

              bar = 'bar value';
              console.log(bar);
              console.log(require('../foo'));
         });
    });

}());

running npm test yields:

Using Jest CLI v0.1.15
Found 1 matching tests...
 PASS  __tests__/foo-test.js (0.03s)
bar value
foo value
@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@cpojer cpojer closed this as completed Oct 16, 2015
@cpojer
Copy link
Member

cpojer commented Oct 16, 2015

Let me know if this is still an issue. It should definitely work as expected in node 4.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants