Skip to content

feat: migrate random#91

Merged
Shinigami92 merged 4 commits intomigrate-to-typescriptfrom
migrate-random
Jan 12, 2022
Merged

feat: migrate random#91
Shinigami92 merged 4 commits intomigrate-to-typescriptfrom
migrate-random

Conversation

@Shinigami92
Copy link
Copy Markdown
Member

test with npm run build && npx mocha test/random.unit.js

@Shinigami92 Shinigami92 added the p: 1-normal Nothing urgent label Jan 11, 2022
@Shinigami92 Shinigami92 self-assigned this Jan 11, 2022
@Shinigami92 Shinigami92 mentioned this pull request Jan 11, 2022
27 tasks
Comment thread src/mersenne.ts Outdated
}

export default Mersenne;
module.exports = Mersenne;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this fails 🤔

> npx mocha test/random.unit.js

TypeError: mersenne_1.Mersenne is not a constructor
    at new Faker (/home/shinigami/OpenSource/faker/lib/index.js:124:25)
    at Object.<anonymous> (/home/shinigami/OpenSource/faker/index.js:3:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/shinigami/OpenSource/faker/test/random.unit.js:5:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.exports.requireOrImport (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/esm-utils.js:42:12)
    at Object.exports.loadFilesAsync (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/esm-utils.js:55:34)
    at Mocha.loadFilesAsync (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/mocha.js:473:19)
    at singleRun (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/cli/run-helpers.js:125:15)
    at exports.runMocha (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/cli/run-helpers.js:190:10)
    at Object.exports.handler (/home/shinigami/OpenSource/faker/node_modules/mocha/lib/cli/run.js:362:11)
    at /home/shinigami/OpenSource/faker/node_modules/mocha/node_modules/yargs/build/index.cjs:443:71

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to change the test 😬

-  var mersenne = new (require('../lib/mersenne'));
+  var mersenne = new (require('../lib/mersenne').Mersenne);

And remove that again

export default Mersenne;
module.exports = Mersenne;

@Shinigami92
Copy link
Copy Markdown
Member Author

We need #90 to get merged, cause the tests depends on system

But also name 🤔

@Shinigami92 Shinigami92 marked this pull request as ready for review January 11, 2022 17:40
Comment thread test/random.unit.js
var _ = require('lodash');
var faker = require('../index');
var mersenne = new (require('../lib/mersenne'));
var mersenne = new (require('../lib/mersenne').Mersenne);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a breaking change, but hopefully no one tried to use it directly 🤔
So I would assume this breaking change would be okay and we just say that in the changelog, just to be safe

@Shinigami92 Shinigami92 force-pushed the migrate-to-typescript branch from 0e7e1ba to 64b8db8 Compare January 11, 2022 19:31
@Shinigami92 Shinigami92 merged commit d2714fd into migrate-to-typescript Jan 12, 2022
@Shinigami92 Shinigami92 deleted the migrate-random branch January 12, 2022 18:03
Shinigami92 added a commit that referenced this pull request Jan 12, 2022
Shinigami92 added a commit that referenced this pull request Jan 12, 2022
Shinigami92 added a commit that referenced this pull request Jan 13, 2022
Shinigami92 added a commit that referenced this pull request Jan 14, 2022
Shinigami92 added a commit that referenced this pull request Jan 14, 2022
damienwebdev pushed a commit that referenced this pull request Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: 1-normal Nothing urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant