/// <reference path="../typings/node/node.d.ts" />

import * as fs from 'fs';

export class Dependument {
  private source: string;
  private output: string;

  constructor(options: any) {
    if (!options) {
      throw new Error("No options provided");
    }

    if (!options.source) {
      throw new Error("No source path specified in options");
    }

    if (!options.output) {
      throw new Error("No output path specified in options");
    }

    this.source = options.source;
    this.output = options.output;
  }

  writeOutput() {
    fs.writeFile(this.output, 'dependument test writeOutput', (err) => {
      if (err) throw err;
      console.log(`Output written to ${this.output}`);
    });
  }
}

/// <reference path="../typings/node/node.d.ts" />

import * as fs from 'fs';

export class Dependument {
  private source: string;
  private output: string;

  constructor(options: any) {
    if (!options.source) {
      throw new Error("No source path specified in options");
    }

    if (!options.output) {
      throw new Error("No output path specified in options");
    }

    this.source = options.source;
    this.output = options.output;
  }

  writeOutput() {
    fs.writeFile(this.output, 'dependument test writeOutput', (err) => {
      if (err) throw err;
      console.log(`Output written to ${this.output}`);
    });
  }
}

--- 
+++ 
@@ -7,6 +7,10 @@
   private output: string;
 
   constructor(options: any) {
+    if (!options) {
+      throw new Error("No options provided");
+    }
+
     if (!options.source) {
       throw new Error("No source path specified in options");
     }
Throw error if no options
