integration-tests-rails 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12ec9fa8a5503ba21d04c3700fee04a00413b072a1adb9918fb75714c3e92c8d
4
- data.tar.gz: 50c08830a21433430b183ae184df578656108d8ca2257317034f686638d6e619
3
+ metadata.gz: 07f7241b5d554a5e0409bf4d955b5bcb859126f394e7eed5513ba6f92a9b3318
4
+ data.tar.gz: 72e0af62570e42a128cbd906b8874e30e69c0e419e898cacc96b936b0f4f3d56
5
5
  SHA512:
6
- metadata.gz: 9ac0c50347e0bfd28fae19f6495fa61ce1977a863929ed99885ed7c1c0b34c1627a3a5fc82dc9a010ba6c6fcf1cb11340191a7e57a1c31862401581759873ad7
7
- data.tar.gz: 3ac047eb7ff7c4da5698b9ea90eb9b0f4e5dedf8f0b5992423a87a582a830b70f339cf3d0309232cf3d0a554a8e2a1fce979e97d8910cf9d07263a75d2879691
6
+ metadata.gz: 9bb1e5c7734164e053e45ab9a0fc17d7134d9a0b525351cafda5812110a26594fac0a363a8d1d415db849394f6d3bc591193fda4a6dba1b8c3d89d253f70909a
7
+ data.tar.gz: 23b0f92a2ecd62af9882abdfb48ca3cf751fd891ff0d6b28e2e39793e259a4b63e8069f0f85a35f65d7ad4c866ade47c1b6b18b888917e2b2b4b40a783ac3f2a
@@ -126,11 +126,13 @@ module IntegrationTestsRails
126
126
  }
127
127
 
128
128
  const instrumentedDir = '#{config.output_path}';
129
+ const backupDir = '#{config.backup_path}';
130
+ const sourceDir = '#{config.source_path}';
129
131
  const instrumentedFiles = findJsFiles(instrumentedDir);
130
132
 
131
133
  instrumentedFiles.forEach(instrumentedFile => {
132
134
  const relativePath = path.relative(instrumentedDir, instrumentedFile);
133
- const originalFile = path.join('#{config.source_path}', relativePath);
135
+ const originalFile = path.join(sourceDir, relativePath);
134
136
 
135
137
  if (coverageMap.data[originalFile]) return;
136
138
 
@@ -140,6 +142,7 @@ module IntegrationTestsRails
140
142
 
141
143
  if (match && match[1]) {
142
144
  const coverageData = eval('(' + match[1] + ')');
145
+ // Keep original path for display
143
146
  coverageData.path = originalFile;
144
147
  coverageMap.addFileCoverage(coverageData);
145
148
  }
@@ -150,7 +153,21 @@ module IntegrationTestsRails
150
153
 
151
154
  const context = libReport.createContext({
152
155
  dir: 'coverage/javascript',
153
- coverageMap: coverageMap
156
+ coverageMap: coverageMap,
157
+ sourceFinder: function(filePath) {
158
+ const relativePath = path.relative(sourceDir, filePath);
159
+ const backupFile = path.join(backupDir, relativePath);
160
+
161
+ try {
162
+ // Read content from backup (original source)
163
+ if (fs.existsSync(backupFile)) {
164
+ return fs.readFileSync(backupFile, 'utf8');
165
+ }
166
+ } catch(e) {
167
+ console.error('Could not read backup file:', backupFile, e.message);
168
+ }
169
+ return null;
170
+ }
154
171
  });
155
172
 
156
173
  ['html', 'lcov', 'cobertura'].forEach(reportType => {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IntegrationTestsRails
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: integration-tests-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tien