acvetkov / sinon-chrome

Testing chrome extensions with Node.js
ISC License
435 stars 46 forks source link

How to test if extension is loadable #41

Closed CrazyPython closed 7 years ago

CrazyPython commented 7 years ago

loadable = on "reload" no yellow box with error

acvetkov commented 7 years ago

@CrazyPython, hi.

What do you mean? Are you talk about invalid manifest? Can you attach an example?

CrazyPython commented 7 years ago

@acvetkov yes, invalid manifest, esp. no file present

acvetkov commented 7 years ago

Probably, you missunderstand something. sinon-chrome does not validate manifest, it's helper tool for testing your code.

CrazyPython commented 7 years ago

@acvetkov what other tool to use then? or can this be implemented?

vitalets commented 7 years ago

@CrazyPython I think the first approach can be verifying that manifest is correct json file, e.g.

var manifest = fs.readFileSync('./src/manifest.json');
try {
  JSON.parse(manifest);
} catch () {
  console.log('Manifest error', manifest);
}
CrazyPython commented 7 years ago

@vitalets That is obvious - but surely if chrome can't load it sinon also can't?

vitalets commented 7 years ago

but surely if chrome can't load it sinon also can't?

I think not. Sinon-chrome currently does not use manifest now.