Skip to content

Commit 329ffe3

Browse files
authored
Merge pull request #175 from NativeScript/romulowspp-readmepluginname
Romulowspp readmepluginname
2 parents a7aa45f + fa1d5a9 commit 329ffe3

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

seed-tests/e2e/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const addContext = require('mochawesome/addContext');
44
const testReporterContext = <ITestReporter>{};
55
testReporterContext.name = "mochawesome";
66
/**
7-
* This folder should be the one provided in mocha.opts.
7+
* This folder should be the one provided in mocha.opts.
88
* If omitted the default one is "mochawesome-report".
9-
* This is necessary because we need the logged images to be relatively
9+
* This is necessary because we need the logged images to be relatively
1010
* positioned according to mochawesome.html in the same folder
1111
*/
1212
testReporterContext.reportDir = "mochawesome-report";

seed-tests/e2e/tests.e2e.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import { AppiumDriver, createDriver, SearchOptions, Direction, nsCapabilities } from "nativescript-dev-appium";
2-
import { isSauceLab, runType } from "nativescript-dev-appium/lib/parser";
1+
import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium";
2+
import { isSauceLab } from "nativescript-dev-appium/lib/parser";
33
import { expect } from "chai";
44
import "mocha";
5-
import { ok } from "assert";
5+
66
const fs = require('fs');
77
const addContext = require('mochawesome/addContext');
88
const rimraf = require('rimraf');
99
const isSauceRun = isSauceLab;
1010

11-
1211
describe("sample scenario", () => {
1312
let driver: AppiumDriver;
1413

15-
before(async function(){
16-
nsCapabilities.testReporter.context = this;
14+
before(async function() {
15+
nsCapabilities.testReporter.context = this;
1716
driver = await createDriver();
1817
driver.defaultWaitTime = 20000;
1918
let dir = "mochawesome-report";

seed-tests/postclone.tests.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,17 @@ describe('postclone', function () {
187187
expect(fs.existsSync(constants.SEED_COPY_LOCATION + "/seed-tests")).toBeFalsy();
188188
});
189189

190-
it('should replace the seed README with the plugin one', function () {
190+
it('should rename each yourplugin file with the new plugin name in README', function () {
191191
expect(fs.existsSync(constants.SEED_COPY_LOCATION + "/README.md")).toBeTruthy();
192-
expect(fs.existsSync(constants.SEED_COPY_LOCATION + "/src/README.md")).toBeFalsy();
193192

194193
var readmeContent = fs.readFileSync(constants.SEED_COPY_LOCATION + "/README.md");
195-
expect(_srcReadmeContent).toEqual(readmeContent);
194+
expect(readmeContent).toContain("nativescript-" + constants.TEST_PLUGIN_NAME);
195+
expect(readmeContent).toContain("tns plugin add nativescript-" + constants.TEST_PLUGIN_NAME);
196+
});
197+
198+
it('should remove old src/README and create a new /README', function() {
199+
expect(fs.existsSync(constants.SEED_COPY_LOCATION + "/README.md")).toBeTruthy();
200+
expect(fs.existsSync(constants.SEED_COPY_LOCATION + "/src/README.md")).toBeFalsy();
196201
});
197202

198203
it('should rename each yourplugin file', function (done) {

src/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Your Plugin Name
1+
# nativescript-yourplugin
22

33
Add your plugin badges here. See [nativescript-urlhandler](https://github.com/hypery2k/nativescript-urlhandler) for example.
44

@@ -15,7 +15,7 @@ Describe the prerequisites that the user need to have installed before using you
1515
Describe your plugin installation steps. Ideally it would be something like:
1616

1717
```javascript
18-
tns plugin add <your-plugin-name>
18+
tns plugin add nativescript-yourplugin
1919
```
2020

2121
## Usage

0 commit comments

Comments
 (0)