Skip to content

test: add integration tests#16

Open
radiovisual wants to merge 15 commits into
developit:masterfrom
radiovisual:add-unit-tests
Open

test: add integration tests#16
radiovisual wants to merge 15 commits into
developit:masterfrom
radiovisual:add-unit-tests

Conversation

@radiovisual
Copy link
Copy Markdown

@radiovisual radiovisual commented Mar 9, 2024

This plugin is missing tests, so I wrote some integration tests that test the plugin with rollup.

Changes

  • Adds integration tests in rollup + plugin
  • Adds a github workflow file to run tests in PRs and merge to master
  • Adds a status badge to the README
  • Fixed a bug that breaks the build if there is whitespace leading the shebang (and corrects the problem by removing the leading whitespace)
  • Updated the README (including removing mention of unsupported code)
  • Adds a status badge to the README

Workflow status

Here is proof that the tests are running and passing on my branch:

Pasted Graphic 4

and here is the status badge:

image

WDYT @developit ?

@radiovisual
Copy link
Copy Markdown
Author

radiovisual commented Mar 10, 2024

Also, according to the README, there is a feature mentioned that you can override the entry file, but that feature seems to have been removed in this commit.

I had this test written for the feature, but of course it was failing, since the feature is not supported:

	it('should override the entry file if a new one is supplied', async () => {
		const inputFilePath = getFixtureFilePath('no-shebang.js');
		const bundle = await getRollUpBundle(inputFilePath, {
			entry: getFixtureFilePath('hello-world-cli.js')
		});
		const generatedCode = await getGeneratedContent(bundle, format);

		expect(generatedCode.split('\n')[0]).toEqual(nodeShebang);
		expect(generatedCode).toMatchSnapshot();
	});

I removed the mention of the unsupported feature via 0b0116b

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.

1 participant