Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix meta module #273

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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