Merge pull request #4625 from smelukov/original-module-source

Add originalSource method to NormalModule
This commit is contained in:
Tobias Koppers 2017-04-03 11:26:07 +02:00 committed by GitHub
commit 4153b58c53
2 changed files with 14 additions and 0 deletions

View File

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

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;