From 4498884f62880a8bae76fad0eee7bfdfe05475ad Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 12 Jun 2016 20:44:34 +0300 Subject: [PATCH] Migrate tests to TypeScript --- .eslintrc | 32 - build/tasks/build.js | 5 +- demo/index.html | 5 + karma.conf.js | 13 +- .../{api-info.spec.js => api-info.spec.ts} | 13 +- .../{api-logo.spec.js => api-logo.spec.ts} | 6 +- ...-lazy.spec.js => json-schema-lazy.spec.ts} | 24 +- ...son-schema.spec.js => json-schema.spec.ts} | 16 +- .../Method/{method.spec.js => method.spec.ts} | 13 +- ...hods-list.spec.js => methods-list.spec.ts} | 14 +- .../Redoc/{redoc.spec.js => redoc.spec.ts} | 44 +- lib/components/Redoc/redoc.ts | 2 +- lib/components/SchemaSample/schema-sample.js | 70 --- .../{side-menu.spec.js => side-menu.spec.ts} | 30 +- lib/components/{base.spec.js => base.spec.ts} | 15 +- lib/components/base.ts | 5 +- lib/index.js | 2 +- ...h.service.spec.js => hash.service.spec.ts} | 0 ...u.service.spec.js => menu.service.spec.ts} | 10 +- ...ervice.spec.js => options.service.spec.ts} | 0 ...sidebar.spec.js => sticky-sidebar.spec.ts} | 6 +- .../Tabs/{tabs.spec.js => tabs.spec.ts} | 5 +- lib/shared/components/Zippy/zippy.css.shim.ts | 5 - .../Zippy/{zippy.spec.js => zippy.spec.ts} | 11 +- lib/utils/JsonPointer.ts | 8 +- lib/utils/SchemaManager.ts | 4 +- tests/{helpers.js => helpers.ts} | 3 +- tests/setup.js | 11 - tests/setup.ts | 20 + ...sonPointer.spec.js => JsonPointer.spec.ts} | 2 +- ...aManager.spec.js => SchemaManager.spec.ts} | 2 +- .../unit/{helpers.spec.js => helpers.spec.ts} | 2 +- tests/unit/pipes.spec.js | 2 +- tsconfig.json | 2 +- typings.json | 5 +- typings/globals/should/index.d.ts | 168 ++++++ typings/globals/should/typings.json | 8 + typings/index.d.ts | 2 +- typings/modules/chai/index.d.ts | 547 ------------------ typings/modules/chai/typings.json | 21 - 40 files changed, 334 insertions(+), 819 deletions(-) delete mode 100644 .eslintrc rename lib/components/ApiInfo/{api-info.spec.js => api-info.spec.ts} (83%) rename lib/components/ApiLogo/{api-logo.spec.js => api-logo.spec.ts} (92%) rename lib/components/JsonSchema/{json-schema-lazy.spec.js => json-schema-lazy.spec.ts} (75%) rename lib/components/JsonSchema/{json-schema.spec.js => json-schema.spec.ts} (76%) rename lib/components/Method/{method.spec.js => method.spec.ts} (72%) rename lib/components/MethodsList/{methods-list.spec.js => methods-list.spec.ts} (72%) rename lib/components/Redoc/{redoc.spec.js => redoc.spec.ts} (85%) delete mode 100644 lib/components/SchemaSample/schema-sample.js rename lib/components/SideMenu/{side-menu.spec.js => side-menu.spec.ts} (63%) rename lib/components/{base.spec.js => base.spec.ts} (96%) rename lib/services/{hash.service.spec.js => hash.service.spec.ts} (100%) rename lib/services/{menu.service.spec.js => menu.service.spec.ts} (92%) rename lib/services/{options.service.spec.js => options.service.spec.ts} (100%) rename lib/shared/components/StickySidebar/{sticky-sidebar.spec.js => sticky-sidebar.spec.ts} (93%) rename lib/shared/components/Tabs/{tabs.spec.js => tabs.spec.ts} (96%) delete mode 100644 lib/shared/components/Zippy/zippy.css.shim.ts rename lib/shared/components/Zippy/{zippy.spec.js => zippy.spec.ts} (93%) rename tests/{helpers.js => helpers.ts} (86%) delete mode 100644 tests/setup.js create mode 100644 tests/setup.ts rename tests/unit/{JsonPointer.spec.js => JsonPointer.spec.ts} (94%) rename tests/unit/{SchemaManager.spec.js => SchemaManager.spec.ts} (99%) rename tests/unit/{helpers.spec.js => helpers.spec.ts} (95%) create mode 100644 typings/globals/should/index.d.ts create mode 100644 typings/globals/should/typings.json delete mode 100644 typings/modules/chai/index.d.ts delete mode 100644 typings/modules/chai/typings.json diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 4876b92f..00000000 --- a/.eslintrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": "eslint:recommended", - "env": { - "browser": true, - "jasmine": true - }, - // currently eslint doesn't support extension-typed configs - "globals": { - "should": true, - "expect": true, - "sinon": true, - "Reflect": true - }, - "rules": { - "quotes": [2, "single"], - "no-console": 0, - "comma-spacing": 2, - "comma-style": [2, "last"], - "consistent-return": 2, - "strict": [2, "global"], - "eqeqeq": [2, "smart"], - "curly": [2, "multi-line"], - "semi-spacing": [2, {"before": false, "after": true}], - "semi": [2, "always"], - "no-extra-semi": 2, - "comma-dangle": [2, "never"], - "no-sequences": 2, - "comma-spacing": [2, {"before": false, "after": true}], - "comma-style": [2, "last"] - } -} diff --git a/build/tasks/build.js b/build/tasks/build.js index 4183af1d..6f8e285c 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -40,7 +40,6 @@ gulp.task('copyDebug', () => { gulp.task('rebuild', function(done) { return runSequence( - 'tsc', 'inlineTemplates', 'bundle', 'concatDeps', @@ -53,8 +52,8 @@ gulp.task('tsc', function() { exec('tsc -p ./tsconfig.json'); }); -gulp.task('inlineTemplates', ['sass'], function() { - return gulp.src('.tmp/lib/**/*.js', { base: './tmp' }) +gulp.task('inlineTemplates', ['tsc', 'sass'], function() { + return gulp.src('.tmp/**/*.js', { base: './tmp' }) .pipe(replace(/'(.*?)\.css'/g, '\'$1.scss\'')) .pipe(inlineNg2Template({ base: './', diff --git a/demo/index.html b/demo/index.html index 08627953..0b3bf995 100644 --- a/demo/index.html +++ b/demo/index.html @@ -4,6 +4,11 @@ ReDoc + +