Skip to content

Commit

Permalink
fix: extend tslint test to cover all test files (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenChen93 committed Oct 30, 2019
1 parent 55da659 commit b142590
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ask-sdk-core/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
12 changes: 6 additions & 6 deletions ask-sdk-core/tst/util/RequestEnvelopeUtil.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import {
getAccountLinkingAccessToken,
getApiAccessToken,
getDeviceId,
getUserId,
getDialogState,
getIntentName,
getRequest,
getLocale,
getRequest,
getRequestType,
getSlot,
getSlotValue,
getSupportedInterfaces,
getUserId,
isNewSession,
} from '../../lib/util/RequestEnvelopeUtils';
import { JsonProvider } from '../mocks/JsonProvider';
Expand All @@ -46,7 +46,7 @@ describe('RequestEnvelopeUtils', () => {
markupVersion : '1.0',
},
};
requestEnvelope.context.System.user.userId = 'mockUserId'
requestEnvelope.context.System.user.userId = 'mockUserId';

const intentRequestEnvelope : RequestEnvelope = JsonProvider.requestEnvelope();
intentRequestEnvelope.request.type = 'IntentRequest';
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('RequestEnvelopeUtils', () => {
});

it('should return the intent request object', () => {
const request = getRequest<IntentRequest>(intentRequestEnvelope)
const request = getRequest<IntentRequest>(intentRequestEnvelope);
expect(request).deep.eq({
type: 'IntentRequest',
requestId: null,
Expand Down Expand Up @@ -132,8 +132,8 @@ describe('RequestEnvelopeUtils', () => {
});

it('should return null if there is no user info', () => {
const requestEnvelopeWithNoUser = Object.assign({}, requestEnvelope)
delete requestEnvelopeWithNoUser.context.System.user
const requestEnvelopeWithNoUser = { ...requestEnvelope };
delete requestEnvelopeWithNoUser.context.System.user;
expect(getUserId(requestEnvelopeWithNoUser)).eq(null);
});

Expand Down
2 changes: 2 additions & 0 deletions ask-sdk-dynamodb-persistence-adapter/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
2 changes: 2 additions & 0 deletions ask-sdk-express-adapter/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
2 changes: 2 additions & 0 deletions ask-sdk-runtime/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
2 changes: 1 addition & 1 deletion ask-sdk-runtime/tst/util/AskSdkUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('AskSdkUtils', () => {
});

it('should be able to create user agent string', () => {
const userAgent = createAskSdkUserAgent('2.0.0',undefined);
const userAgent = createAskSdkUserAgent('2.0.0', undefined);

expect(userAgent).equal(`ask-node/2.0.0 Node/${process.version}`);
});
Expand Down
2 changes: 2 additions & 0 deletions ask-sdk-s3-persistence-adapter/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
2 changes: 2 additions & 0 deletions ask-sdk-v1adapter/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down
2 changes: 2 additions & 0 deletions ask-sdk/gulpfile-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ module.exports = {
tslint : (done) => {
const tslintPath = path.normalize('./node_modules/.bin/tslint');
const command = `${tslintPath} -p tsconfig.json -c tslint.json`;
const commandForTests = `${tslintPath} ./tst/**/*.ts -c tslint.json`;

exec(command, done);
exec(commandForTests, done);
},
test : (done) => {
const nycPath = path.normalize('./node_modules/.bin/nyc');
Expand Down

0 comments on commit b142590

Please sign in to comment.