Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for replacing with string #10

Merged
merged 4 commits into from
Feb 26, 2018

Conversation

ludalex
Copy link
Contributor

@ludalex ludalex commented Feb 24, 2018

This adds the support for replacing the marker with a simple string instead of a file content as requested here #9

index.js Outdated
strings[key] = startMarker + fs.readFileSync(contentFilePath) + endMarker;
} else if(content.string && typeof content.string === 'string') {
strings[key] = content.string;
Copy link
Owner

Choose a reason for hiding this comment

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

You are missing the markers here. change line to:

strings[key] = startMarker + content.string + endMarker;

This causes the following failure: https://travis-ci.org/ramybenaroya/ember-index/jobs/345734590#L986

}, {
key: 'coloring-script',
file: '_emberIndexContent/coloring-script.txt',
includeInOutput: false,
includeInIndexHtml: true
}],
},],
Copy link
Owner

Choose a reason for hiding this comment

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

please remove comma here


contentFor = addon.contentFor('ember-index-4');

expect(contentFor).to.be.equal(addon._startMarkerPrefix + '-3' + '<!-- content from string -->' + addon._endMarkerPrefix + '-3');
Copy link
Owner

@ramybenaroya ramybenaroya Feb 25, 2018

Choose a reason for hiding this comment

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

You have a typo( -3 instead of -4). change the line to:

expect(contentFor).to.be.equal(addon._startMarkerPrefix + '-4' + '<!-- content from string -->' + addon._endMarkerPrefix + '-4');

@ramybenaroya
Copy link
Owner

ramybenaroya commented Feb 25, 2018

Thank you for this PR. The tests are currently failing. Please check my requests for changes so it will pass.
You can run the addon unit tests locally with npm run test-mocha

@ludalex
Copy link
Contributor Author

ludalex commented Feb 25, 2018

Done. Tests are failing for default and beta scenarios (they just hang forever). I guess it's because addon's ember-cli needs to be updated?

@ramybenaroya
Copy link
Owner

Thanks. I'll rerun the master build and check that.

@ramybenaroya ramybenaroya merged commit 542356e into ramybenaroya:master Feb 26, 2018
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.

2 participants