added test for NormalModule.originalSource

This commit is contained in:
Sergey Melyukov 2017-04-03 10:48:55 +03:00
parent 9d8d32e1ed
commit 0cab30c950
2 changed files with 13 additions and 3 deletions

View File

@ -456,9 +456,9 @@ class NormalModule extends Module {
return new CachedSource(source);
}
originalSource() {
return this._source;
}
originalSource() {
return this._source;
}
getHighestTimestamp(keys, timestampsByKey) {
let highestTimestamp = 0;

View File

@ -141,6 +141,16 @@ describe("NormalModule", function() {
});
});
describe("#originalSource", function() {
let expectedSource = "some source";
beforeEach(function() {
normalModule._source = new RawSource(expectedSource);
});
it("returns an original Source", function() {
normalModule.originalSource().should.eql(normalModule._source);
});
});
describe("#updateHashWithSource", function() {
let hashSpy;
let hash;