Skip to content

Commit

Permalink
test: fix aliases and add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
brettdh committed Oct 4, 2020
1 parent 4005ed7 commit 4da76e2
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm ci
- run: npm run build
- run: npm test
- run: npm run lint
- run: npm run build
2 changes: 1 addition & 1 deletion android/native/buildnum/code.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/android-code');
module.exports = require('../../../build/bumpers/native/buildnum/android-code').default;
2 changes: 1 addition & 1 deletion android/native/buildnum/increment.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/android-increment');
module.exports = require('../../../build/bumpers/native/buildnum/android-increment');
2 changes: 1 addition & 1 deletion android/native/buildnum/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/android-code');
module.exports = require('../../../build/bumpers/native/buildnum/android-code').default;
2 changes: 1 addition & 1 deletion ios/native/buildnum/code.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/ios-code');
module.exports = require('../../../build/bumpers/native/buildnum/ios-code').default;
2 changes: 1 addition & 1 deletion ios/native/buildnum/increment.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/ios-increment');
module.exports = require('../../../build/bumpers/native/buildnum/ios-increment');
2 changes: 1 addition & 1 deletion ios/native/buildnum/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/ios-version');
module.exports = require('../../../build/bumpers/native/buildnum/ios-version');
2 changes: 1 addition & 1 deletion ios/native/buildnum/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('../../build/bumpers/native/buildnum/ios-version');
module.exports = require('../../../build/bumpers/native/buildnum/ios-version');
21 changes: 21 additions & 0 deletions test/aliases.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import globby from 'globby';

/* eslint-disable @typescript-eslint/no-var-requires */

describe('bumper aliases', () => {
const aliases = globby.sync(['android/**/*', 'ios/**/*']);
aliases.forEach(path => {
describe(path, () => {
it('is importable', () => {
const bumperModule = require(`../${path}`);

let bumper = bumperModule;
if (bumperModule instanceof Function) {
bumper = bumperModule('37.0.0'); // dummy SDK version
}
expect(bumper.readVersion).toBeInstanceOf(Function);
expect(bumper.writeVersion).toBeInstanceOf(Function);
});
});
})
});

0 comments on commit 4da76e2

Please sign in to comment.