-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from ndaidong/3.0.4
v3.0.4
- Loading branch information
Showing
8 changed files
with
56 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// release.test | ||
|
||
/* eslint-env jest */ | ||
|
||
import { | ||
existsSync, | ||
readFileSync | ||
} from 'fs' | ||
|
||
const pkg = JSON.parse(readFileSync('./package.json')) | ||
|
||
const cjsFile = `./dist/cjs/${pkg.name}.js` | ||
const cjsPkg = JSON.parse(readFileSync('./dist/cjs/package.json')) | ||
|
||
const esmFile = `./dist/${pkg.name}.esm.js` | ||
const minFile = `./dist/${pkg.name}.min.js` | ||
|
||
describe('Validate commonjs version output', () => { | ||
test(`Check if ${cjsFile} created`, () => { | ||
expect(existsSync(cjsFile)).toBeTruthy() | ||
}) | ||
test('Check if cjs package info updated', () => { | ||
expect(cjsPkg.name).toEqual(`${pkg.name}-cjs`) | ||
expect(cjsPkg.version).toEqual(pkg.version) | ||
}) | ||
const constent = readFileSync(cjsFile, 'utf8') | ||
const lines = constent.split('\n') | ||
test('Check if file meta contains package info', () => { | ||
expect(lines[0].includes(`${pkg.name}@${pkg.version}`)).toBeTruthy() | ||
expect(lines[0].includes(pkg.author)).toBeTruthy() | ||
expect(lines[0].includes(pkg.license)).toBeTruthy() | ||
}) | ||
}) | ||
|
||
describe('Check other built files', () => { | ||
test(`Check if ${esmFile} created`, () => { | ||
expect(existsSync(esmFile)).toBeTruthy() | ||
}) | ||
test(`Check if ${minFile} created`, () => { | ||
expect(existsSync(minFile)).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "txtgen-cjs", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"main": "./txtgen.js" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.