Skip to content

Commit

Permalink
fix: fix failing tests due to Node require issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed Apr 4, 2017
1 parent 3d43191 commit f8b51ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/timeline/timeline.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';

import { TwitterService } from '../twitter.service';
import packageJSON from '../../../package.json';
const packageJSON = require('../../../package.json');

const MAX_DURATION_PER_TWEET = 5000;

Expand Down
2 changes: 1 addition & 1 deletion src/app/twitter.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';

import { intensity } from './helpers/intensity';
import tweets from './twitter.service.data.json';
const tweets = require('./twitter.service.data.json');

@Injectable()
export class TwitterService {
Expand Down
8 changes: 3 additions & 5 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/// <reference types="node" />

/* SystemJS module definition */
declare var module: NodeModule;

interface NodeModule {
id: string;
}
Expand All @@ -8,8 +11,3 @@ interface Tweet {
id_str: string;
text: string;
}

declare module "*.json" {
const value: any;
export default value;
}

0 comments on commit f8b51ac

Please sign in to comment.