Skip to content

Conversation

@rolodato
Copy link
Contributor

Couldn't figure out how to add a test case to https://github.com/Flagsmith/engine-test-data/blob/e43097ee273fa63dbb9589c02f89df3d10b51044/data/environment_n9fbf9h3v4fFgH3U3ngWhb.json - verified manually with the following test:

// test.cjs

const Flagsmith = require('./build/cjs').Flagsmith

const flagsmith = new Flagsmith({
    environmentKey: 'LMVKS7tqAcQrjtsDWLoe7g',
});

const flags = await flagsmith.getEnvironmentFlags();
const value = flags.getFeatureValue('zero');

console.log(value);

Before:

rolodato@rolosmith flagsmith-nodejs-client % bun run build && bun test.cjs
$ rm -rf ./build
$ tsc -b tsconfig.cjs.json tsconfig.esm.json && echo '{"type": "commonjs"}'> build/cjs/package.json
undefined

After:

rolodato@rolosmith flagsmith-nodejs-client % bun run build && bun test.cjs 
$ rm -rf ./build
$ tsc -b tsconfig.cjs.json tsconfig.esm.json && echo '{"type": "commonjs"}'> build/cjs/package.json
0

@rolodato rolodato merged commit d52fbac into main Jan 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants