Skip to content

Commit

Permalink
🐛 Fix meta module (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil Wilsman authored Apr 8, 2021
1 parent eb8084f commit 654a31c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions addon-test-support/@percy/ember/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import utils from '@percy/sdk-utils';
import { VERSION as emberVersion } from '@ember/version';
import { VERSION as sdkVersion, PERCY_SERVER_ADDRESS } from '@percy/ember/meta';
import SDKENV from '@percy/ember/env';

// Collect client and environment information
const CLIENT_INFO = `@percy/ember/${sdkVersion}`;
const CLIENT_INFO = `@percy/ember/${SDKENV.VERSION}`;
const ENV_INFO = [`ember/${emberVersion}`];

if (window.QUnit) ENV_INFO.push(`qunit/${window.QUnit.version}`);
if (window.mocha) ENV_INFO.push(`mocha/${window.mocha.version}`);

// Maybe set the CLI API address from the environment
utils.percy.address = PERCY_SERVER_ADDRESS;
utils.percy.address = SDKENV.PERCY_SERVER_ADDRESS;

// Helper to generate a snapshot name from the test suite
function generateName(assertOrTestOrName) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
},

treeForAddonTestSupport(tree) {
let meta = new WriteFile('@percy/ember/meta.js', (
let meta = new WriteFile('@percy/ember/env.js', (
`export default ${JSON.stringify({
VERSION: pkg.version,
PERCY_SERVER_ADDRESS: process.env.PERCY_SERVER_ADDRESS
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module('percySnapshot', hooks => {
assert.equal(reqs[2][1].name, 'Snapshot 1');
assert.matches(reqs[2][1].url, /^http:\/\/localhost:7357/);
assert.matches(reqs[2][1].domSnapshot, /<body class="ember-application"><\/body>/);
assert.matches(reqs[2][1].clientInfo, /@percy\/ember\/.+/);
assert.matches(reqs[2][1].clientInfo, /@percy\/ember\/\d.+/);
assert.matches(reqs[2][1].environmentInfo[0], /ember\/.+/);
assert.matches(reqs[2][1].environmentInfo[1], /qunit\/.+/);

Expand Down

0 comments on commit 654a31c

Please sign in to comment.