Comments (4)
What's your environment.js look like, as well as which environment variables are set?
from ember-cli.
hmm it's possible that they are running in two different js environments -- config/environment.js in node, the helper function, browser. But I would still expect the config environment to be built by node?
Thanks for the quick response.
config/environment.js looks like essentially:
'use strict';
module.exports = function () {
let ENV = {
APP: {
IS_TEST_ENV: false
}
};
if (process.env.TEST_FLAG) {
ENV.APP.IS_TEST_ENV = true;
}
console.log('output env', ENV.APP);
// output env {
// IS_TEST_ENV: true,
// }
return ENV;
};
Then, when imported into a test helper that runs prior to each qunit test the incoming value is different when logged:
import ENV from 'company/config/environment';
export default function (hooks) {
hooks.beforeEach(function () {
console.log(JSON.stringify(ENV.APP), 'env app');
// {"type":"log","text":"{\"IS_TEST_ENV\":false, }}
if (ENV.APP.IS_TEST_ENV) {
// never gets to this
console.log('DO SOMETHING HERE');
}
});
}
I've also tried directly setting the process.env directly on the initial object. I've tried using strings to set values as well. I've also tried setting the value on part of the object that's not within the app key. This works as expected locally but not within circle ci.
Note I can't use the environment incoming value because test, production, and development are already in use and mixed with other variables
from ember-cli.
Problem was a ember buld step that seemed to be the source of truth for the ember test's environment.
from ember-cli.
for testing the test environment, you'd probably want import { isTesting, macroCondition } from
@embroider/macros`
if (macroCondition(isTesting()) {
}
this way, when isTesting() is false, you don't ship test code to production 🎉
from ember-cli.
Related Issues (20)
- fingerprint.prepend not working for the chunk js files HOT 3
- [email protected] has security vulnerability HOT 2
- Setup ESLint for gjs/gts
- You passed the '--typescript' flag but there is no TypeScript blueprint available. A JavaScript blueprint will be generated instead. HOT 7
- new typescript component blueprint gives eslint warning HOT 3
- Fresh app 404's on missing assets/test-support.css HOT 8
- Could it be possible to use `--directory` to output to an already existing directory? HOT 1
- Add a `--no-ci-provider` flag for `ember new`
- App blueprint has invalid ESLint config HOT 4
- Add bun support for Ember CLI projects HOT 1
- --port=4200 not working HOT 7
- Security vulnerability in lodash.template package HOT 2
- "hifi sourcemaps" don't work on a new Ember project HOT 2
- Deprecation warning on Node 22 HOT 1
- qunit-dom is too old. current app uses v2, but v3 is a v2 addon. HOT 2
- Lint dependencies are out of date.
- existing lint config too hard to use with gjs/gts, needs update
- ember serve - ENOENT: no such file or directory HOT 4
- Security vulnerability with `braces` package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli.