Skip to content

Commit

Permalink
Merge pull request #30 from Polymer/dep-check-testing
Browse files Browse the repository at this point in the history
add basic testing to check dependencies
  • Loading branch information
FredKSchott committed Apr 29, 2016
2 parents 2ccc7fa + ac0ccd6 commit 16af39e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ node_js:
- "5"
sudo: false
before_script:
- npm install -g typescript typings
- npm install
- npm run init
script:
- npm run build
script:
- npm run test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"bin": "bin/polytool.js",
"scripts": {
"init": "typings install",
"build": "if [ ! -f typings/main.d.ts ]; then npm run init; fi; tsc"
"build": "if [ ! -f typings/main.d.ts ]; then npm run init; fi; tsc",
"test": "depcheck ."
},
"repository": {
"type": "git",
Expand All @@ -33,6 +34,7 @@
"yeoman-environment": "^1.5.2"
},
"devDependencies": {
"depcheck": "^0.6.3",
"typescript": "^1.8.10",
"typings": "^0.8.1"
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Command} from './command';

// not ES modules compatible
const YeomanEnvironment = require('yeoman-environment');
const polymerGenerator = require('generator-polymer-init');

export class InitCommand implements Command {
name = 'init';
Expand All @@ -23,7 +24,7 @@ export class InitCommand implements Command {
run(options): Promise<any> {
return new Promise((resolve, reject) => {
let env = new YeomanEnvironment();
env.register(require.resolve('generator-polymer-init'), 'polymer-init:app');
env.registerStub(polymerGenerator, 'polymer-init:app');
env.run('polymer-init', {}, () => resolve());
});
}
Expand Down

0 comments on commit 16af39e

Please sign in to comment.