Git Product home page Git Product logo

compat-tester's People

Contributors

sphinxknight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

compat-tester's Issues

HTML: detect global attributes

So far, only element-specific attributes are detected. Since data have been added to the browser-compat-data repo, the tool should detect such attributes and report accordingly.

Module Methods Look for 'index.html'

Here's the code:

const ct = require('compat-tester');
let report = ct.htmlFileAnalyzer('new-tab.html', 'scope.json');
console.log(report);

It's in a file called 'Index.js', run with:

node index.js

It gives this output:

Using index.html as the root and scope.json as the scope descriptor
undefined
events.js:165
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'index.html'
Emitted 'error' event at:
    at fs.js:2068:12
    at FSReqWrap.oncomplete (fs.js:153:20)

Add a --help option to get usage information

Currently, specifying --help results in an error:

$ compat-tester --help
fs.js:651
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'scope.json'
    at Object.fs.openSync (fs.js:651:18)
    at Object.fs.readFileSync (fs.js:553:33)
    at Object.<anonymous> (/Users/sheppy/.nvm/versions/node/v8.1.2/lib/node_modules/compat-tester/index.js:69:29)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)

Ideally, this should provide usage information instead.

options is undefined, when using as a module

Trying to use compat.htmlFileAnalyzer() (the module way) I'm facing an error:

if((options.contrib === "true" || options.contrib === "all" ) && versionAddedElem === true){
           ^
TypeError: Cannot read property 'contrib' of undefined

But as far as I understand, there's no way to provide options when using compat-tester as a module, is there?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.