Skip to content

Commit

Permalink
Fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doosuu committed Jun 11, 2024
1 parent 2cf04cb commit 6f88a2e
Showing 1 changed file with 67 additions and 9 deletions.
76 changes: 67 additions & 9 deletions test/system-test/sync.stest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,57 @@ describe('CLI command', () => {
const syncOutput = spawnSync(VELOCITAS_PROCESS, ['sync'], { encoding: DEFAULT_BUFFER_ENCODING });
expect(syncOutput.status).to.equal(0);

const resultOne = spawnSync(`./${fileOneDestination}`, {
const resultOne = readFileSync(`./${fileOneDestination}`, {
encoding: DEFAULT_BUFFER_ENCODING,
});
expect(resultOne.stdout).to.contain('projectTest');
expect(resultOne.stdout).to.contain('packageTestOne');
expect(resultOne.stdout).to.contain(1);
expect(resultOne).to.equal(
`#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
const resultTwo = spawnSync(`./${fileTwoDestination}`, {
echo projectTest
echo packageTestOne
echo 1
`,
);

const resultTwo = readFileSync(`./${fileTwoDestination}`, {
encoding: DEFAULT_BUFFER_ENCODING,
});
expect(resultTwo.stdout).to.contain('projectTest');
expect(resultTwo.stdout).to.contain('packageTestTwo');
expect(resultTwo.stdout).to.contain(2);
expect(resultTwo).to.equal(
`#!/bin/bash
# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
echo projectTest
echo packageTestTwo
echo 2
`,
);

const resultThree = readFileSync(`./${fileThreeDestination}`, {
encoding: DEFAULT_BUFFER_ENCODING,
Expand All @@ -68,7 +106,27 @@ describe('CLI command', () => {
const resultFour = readFileSync(`./${fileFourDestination}`, {
encoding: DEFAULT_BUFFER_ENCODING,
});
expect(resultFour).to.equal('projectTest');
expect(resultFour).to.equal(
`# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
FROM packageTestTwo
RUN ls -al
`,
);
});
});
});

0 comments on commit 6f88a2e

Please sign in to comment.