Skip to content

Commit 0cab30c

Browse files
author
Sergey Melyukov
committed
added test for NormalModule.originalSource
1 parent 9d8d32e commit 0cab30c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎lib/NormalModule.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ class NormalModule extends Module {
456456
return new CachedSource(source);
457457
}
458458

459-
originalSource() {
460-
return this._source;
461-
}
459+
originalSource() {
460+
return this._source;
461+
}
462462

463463
getHighestTimestamp(keys, timestampsByKey) {
464464
let highestTimestamp = 0;

‎test/NormalModule.test.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ describe("NormalModule", function() {
141141
});
142142
});
143143

144+
describe("#originalSource", function() {
145+
let expectedSource = "some source";
146+
beforeEach(function() {
147+
normalModule._source = new RawSource(expectedSource);
148+
});
149+
it("returns an original Source", function() {
150+
normalModule.originalSource().should.eql(normalModule._source);
151+
});
152+
});
153+
144154
describe("#updateHashWithSource", function() {
145155
let hashSpy;
146156
let hash;

0 commit comments

Comments
 (0)