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.

improve es-modules documentation (was: nyc ignores non-strict mode js files)

See original GitHub issue

Description

JS files that are not in strict mode ('use strict';) are ignored by nyc and never show up in the report, even with --all and explicit inclusion --include=non-strict-file.js. When I enable strict mode on the same file, it gets included.

I could not find any documentation that states this requirement or an option to control this.

Expected Behavior

Coverage is calculated for non strict mode files as well.

Observed Behavior

Coverage is not done for non-strict mode javascript source files.

Troubleshooting steps

  • still occurring when I put cache: false in my nyc config

Environment Information

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 505.48 MB / 16.00 GB
  Binaries:
    Node: 12.12.0 - /usr/local/bin/node
    npm: 6.12.0 - /usr/local/bin/npm
  npmPackages:
    nyc: ^14.1.1 => 14.1.1

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
alexklicommented, Dec 5, 2020

It seems the documentation should be improved - see above. I updated the title.

0reactions
stale[bot]commented, Apr 16, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strict mode - JavaScript - MDN Web Docs
JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode".
Read more >
Node JS avoid laboriously adding "use strict" to all my files
use-strict-cli is a Node.js command line tool for adding/removing "use strict" statements within files found in given directories.
Read more >
ECMAScript 2015 Language Specification – ECMA-262 6th ...
A complete ECMAScript program may be composed of both strict mode and non-strict mode ECMAScript source text units. In this case, strict mode...
Read more >
Overview - TypeScript
TypeScript 3.5 improves on 3.4's --incremental build mode, by saving information ... See Type checking JavaScript Files documentation for more details.
Read more >
@babel/plugin-transform-strict-mode | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
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